February 2018
Beginner to intermediate
258 pages
5h 47m
English
We will use caret to try different classifiers at once:
library(caret)
We first need to prepare the training scheme:
control <- trainControl(method="cv", repeats=5)
And we will set up the different models to try:
Do not forget to set the seed for the random number generator, to make the results repeatable:
set.seed(7) modelRF <- train( label~., data=df, method="rf", trControl=control ) modelGbm <- train( label~., data=df, method="gbm", trControl=control, verbose=FALSE )modelLogitBoost <- train( label~., data=df, method="LogitBoost", trControl=control
)modelNaiveBayes <- train( label~., data=df, method="nb", trControl=control )
The training ...
Read now
Unlock full access