A single train-test split gives a noisy estimate of model performance — different splits give different results, especially on small datasets.
A resampling technique that repeatedly splits data into train and validation sets to get a more robust estimate of model performance.
- Choose k (typically 5 or 10)
- Split data into k roughly equal folds
- For each fold i: train on all folds except i, validate on fold i
- Compute performance metric for each fold
- Average the k performance scores for final estimate
- Robust: reduces variance of performance estimate compared to single split
- Computationally expensive: requires training k models instead of one
- Data-efficient: uses all data for both training and validation (just not simultaneously)
- Standard: the gold standard for model evaluation in ML research
- Built from: Train-Test Split — cross-validation is a multi-split extension
- Related: Overfitting — CV helps detect overfitting more reliably
- Related: Supervised Learning — CV is used to evaluate supervised models
- Related: Data Modeling — model selection uses CV to compare algorithms
- Time series data: standard k-fold breaks temporal ordering (use time-series CV)
- Data leakage: preprocessing (normalization) must be done inside each fold
- Stratification: for classification, ensure each fold has representative class proportions
- Small datasets: leave-one-out CV (k=n) can have high variance despite being “exact”