Skip to content
p.mba

Type to search tools, guides, glossary terms, frameworks, formula sheets and pages.

Menu

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

Hypothetical: with 1,000 customer records and 5-fold cross-validation, a churn model is trained five times on 800 records and tested on the other 200. Test accuracy across folds is 81%, 79%, 83%, 80% and 82%, for an average of 81%.

Try it in a tool

  • 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.

Courses

More in Data Science & AI

All glossary terms