4.2 Judge, Jury, and Classifier: An Introduction to Trees

Video 6: Cross-Validation

Important Note: In this video, we install and load two new packages so that we can perform cross-validation: "caret", and "e1071". You may need to additionally install and load the following packages for cross-validation to work on your computer: "class" and "ggplot2". If you receive an error message after trying to load caret and e1071, please try installing and loading these two additional packages.

Flash and JavaScript are required for this feature.

Cross-Validation for Random Forests

You might be wondering why we used cross-validation on our CART model, but not on our random forest model. According to the creaters of the random forest algorithm, the model is not very sensitive to the parameters and therefore does not easily overfit to the training set. You can read more on the Random Forests website

However, if you are interested in experimenting with the parameters of the random forest model more, you can read about the parameters and cross-validation for random forests in the This resource may not render correctly in a screen reader.documentation for the randomForest package (PDF).