APM_Exercises
APM_Exercises copied to clipboard
setting n.minobsinnode in Ch08
https://topepo.github.io/caret/model-training-and-tuning.html#basic-parameter-tuning
For a gradient boosting machine (GBM) model, there are three main tuning parameters:
- ...
- the minimum number of training set samples in a node to commence splitting (n.minobsinnode)
<<ch08_permeabilityGBMTune, echo = TRUE, eval = TRUE, cache = TRUE>>=
set.seed(614)
gbmGrid <- expand.grid(interaction.depth=seq(1,6,by=1),
n.trees=c(25,50,100,200),
shrinkage=c(0.01,0.05,0.1))
gbmPermTune <- train(x = trainFingerprints, y = log10(trainPermeability),
method = "gbm",
verbose = FALSE,
tuneGrid = gbmGrid,
trControl = ctrl)
@
Error: The tuning parameter grid should have columns n.trees, interaction.depth, shrinkage, n.minobsinnode
Sinew the book was written, an extra tuning parameter was added to the model code. You can use
gbmGrid <- expand.grid(interaction.depth=seq(1,6,by=1),
n.trees=c(25,50,100,200),
shrinkage=c(0.01,0.05,0.1),
n.minobsinnode = 10)