Most of the models that can be used with caret have certain hyperparameters. These are not estimated by each algorithm, but rather, need to be adjusted by the user. The strategy is to tune them in order to minimize some cross-validation error. caret has a variety of tools for tuning these hyperparameters that we will explore in this recipe.
Model tuning
Getting ready
The caret package needs to be installed using install.packages("caret").
How to do it...
In this recipe, we will work with the mushroom dataset that we used in the first recipe of this chapter and...