Definition
K-fold cross-validation splits data into k parts, trains on k−1, tests on the held-out fold, and averages results. It uses data more efficiently than a single train/test split.
Time-series and grouped data need special CV schemes to avoid leakage.
In simple terms
Instead of one practice exam, you rotate which chapter you leave out as the "test" — getting a fairer sense of readiness.
Where you see it
- Tuning hyperparameters without burning the final test set.
- Reporting robust metrics on small biomedical or low-resource NLP datasets.
How it works
1.Split into folds
Partition examples into k groups.
2.Rotate holdouts
Each fold serves as validation once.
3.Average scores
Report mean and variance of metrics.
Why it matters
- Cross-validation reduces luck from a single lucky or unlucky split — critical on small datasets.
Often confused
Cross-validation replaces a final test set.
Keep a true holdout for final reporting after model selection.