Skip to content

Instantly share code, notes, and snippets.

@bkanpetch

bkanpetch/GBM 1 Secret

Last active June 10, 2016 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkanpetch/58729cdc674bad93adb7d3c5ff027c51 to your computer and use it in GitHub Desktop.
Save bkanpetch/58729cdc674bad93adb7d3c5ff027c51 to your computer and use it in GitHub Desktop.
#### Train GBM model 1 ####
gbm.ctrl <- trainControl(method = 'repeatedcv',
number = 3,
summaryFunction = AMS_summary)
gbm.grid <- expand.grid(n.trees = c(50,100,150),
interaction.depth = c(1,5,9),
shrinkage = c(0.01, 0.005, 0.001),
n.minobsinnode = c(10,100,1000))
gbm.model <- train(x = sub.train, y = sub.label, method = 'gbm', weights = sub.weight,
verbose = TRUE, trControl = gbm.ctrl, tuneGrid = gbm.grid, metric = 'AMS')
gbm.model
plot(gbm.model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment