Glossary · Data Science & AI
Cross-Validation
Also called: k-fold cross-validation · CV
Estimating how well a model will predict new data by repeatedly training on part of the data and testing on the part held out.
Definition
Cross-validation splits the data into k folds, trains the model on k − 1 of them, measures error on the remaining fold, and repeats until each fold has served once as the test set. Averaging the k test errors gives a more reliable estimate of out-of-sample performance than a single train-test split, especially with limited data. It is the standard way to compare models and tune settings such as regularization strength without overfitting to one lucky split. For time series, folds must respect time order so the model never trains on the future.
Worked example
Try it in a tool
Related terms
- Overfitting: When a model learns the noise and quirks of its training data so closely that it performs poorly on new data.
- Bias-Variance Tradeoff: The tension between models too simple to capture real patterns (high bias) and models so flexible they chase noise (high variance).
- Supervised Learning: Machine learning that trains a model on examples with known answers (labels) so it can predict the answer for new cases.
- Machine Learning: Methods that let computers learn patterns from data to make predictions or decisions without being explicitly programmed with rules.