Cross-Validation
Explore how to use cross-validation, especially K-Fold and stratified K-Fold, to improve model evaluation with scikit-learn. Understand creating synthetic validation sets, splitting data properly, and measuring model metrics for classification and regression.
We'll cover the following...
We'll cover the following...
Chapter Goals:
- Learn about the purpose of cross-validation
- Implement a function that applies the K-Fold cross-validation algorithm to a model
A. Additional evaluation datasets
Sometimes, it's not enough to just have a single testing set for model evaluation. Having additional sets of data for evaluation gives us a more accurate measurement of how good the model is for the original dataset.
If the original dataset is big enough, we can actually split it into three subsets: training, testing, and validation. ...