Training models with cross validation
In this section, we will efficiently train our first predictive model for this example and build the corresponding confusion matrix. Most of the functionality comes from the excellent caret
package. You can find more information on the vast features within this package that we will not explore in this book in its documentation (http://topepo.github.io/caret/index.html).
Training our first predictive model
Following best practices, we will use Cross Validation (CV) as the basis of our modeling process. Using CV we can create estimates of how well our model will do with unseen data. CV is powerful, but the downside is that it requires more processing and therefore more time. If you can take the computational complexity, you should definitely take advantage of it in your projects.
Going into the mathematics behind CV is outside of the scope of this book. If interested, you can find out more information on Wikipedia (https://en.wikipedia.org/wiki/Cross-validation_...