Skip to content

Instantly share code, notes, and snippets.

@WalkerHarrison
Created December 13, 2017 20:36
Show Gist options
  • Save WalkerHarrison/9d35474d4b9a24d8a0f925d87f16c0cb to your computer and use it in GitHub Desktop.
Save WalkerHarrison/9d35474d4b9a24d8a0f925d87f16c0cb to your computer and use it in GitHub Desktop.
train = paint_train %>% select(-logprice)
train.y = paint_train %>% select(logprice) %>% pull()
data.new <- paint_test %>% select(-logprice) %>% data.matrix()
xgb.fit <- xgboost(data = data.matrix(train),
label = train.y,
objective = "reg:linear",
eval_metric = "rmse",
max.depth = 10,
eta = 0.05,
nround = 75,
verbose =0)
xgb.pred <- exp(predict(xgb.fit, newdata = data.new))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment