1.1 Train control
trainControl()
function takes in several arguments.3 Here is where we provide caret
with information on how to train the model. Here is a list of things you can do with trainControl
–
You can specify the method for resampling such as
boot
,cv
, etc. In most machine learning tasks, we prefer to use cross validation or its variants.4You can specify preprocssing options such as scaling continuous values and imputing missing values.
You can balance classes using up sampling, down sampling, or SMOTE.5
There many other arguments in this function and I strongly recommend you to look at caret
documentation.
In your RStudio console type
?caret::trainControl()
to get the full syntax and argument description.↩Read my note on cross validation if you want to understand its mechanics: http://rpubs.com/malshe/212816↩
We will see an example of SMOTE in the insurance call data set.↩