Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
caret Package Transformations, filters, and other operations can be applied to To choose how to summarize a model, the trainControl
Cheat Sheet the predictors with the preProc option. function is used again.
• Set the random number seed prior to calling train repeatedly train(x = x, y = y, method = "glmnet",
to get the same resamples across calls. Many train options can be specified using the trainControl preProc = c("center", "scale"),
function: tuneGrid = grid)
• Use the train option na.action = na.pass if you will
being imputing missing data. Also, use this option when train(y ~ ., data = dat, method = "cubist",
predicting new data containing missing values. trControl = trainControl(<options>))
Random Search
To pass options to the underlying model function, you can pass
them to train via the ellipses: Resampling Options For tuning, train can also generate random tuning parameter
train(y ~ ., data = dat, method = "rf", combinations over a wide range. tuneLength controls the total
# options to `randomForest`: trainControl is used to choose a resampling method: number of combinations to evaluate. To use random search:
importance = TRUE)
trainControl(method = <method>, <options>)
trainControl(search = "random")