What does 5-fold cross-validation do?
Options
- Trains one model on 80% of the data and tests it on the other 20%, repeated five times with the same split
- Draws five random samples with replacement and averages the models
- Trains five models with different random seeds on all the data and averages them
- Splits the data into five parts and trains five models, each time validating on a different part, then averages the scores (Correct option)
Answer
Splits the data into five parts and trains five models, each time validating on a different part, then averages the scores
Why
Each fold is used exactly once as validation data while the other four train the model. The five scores are averaged, and their spread tells you how stable the result is.
It uses all the data for both training and validation, which helps when the dataset is small.
It costs k training runs.
Remember
k folds, k models, each fold validates once.