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

  1. 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.4

  2. You can specify preprocssing options such as scaling continuous values and imputing missing values.

  3. 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.


  1. In your RStudio console type ?caret::trainControl() to get the full syntax and argument description.

  2. Read my note on cross validation if you want to understand its mechanics: http://rpubs.com/malshe/212816

  3. We will see an example of SMOTE in the insurance call data set.