Cross-Validation
Last Updated: July 29, 2026 | By Mihail Sebastian | AI Dictionary
An evaluation method that rotates which slice of a dataset is held out for testing, producing a reliable estimate of how a model handles new data.
What is Cross-Validation?
Cross-validation is an evaluation method that splits a dataset into several parts (folds) and rotates which fold is held out for testing, so every data point serves in both training and evaluation. Averaging the scores across rotations estimates how the model will perform on data it has never seen.
A single train/test split answers with one number that depends on luck of the draw. Cross-validation replaces that with several numbers and their spread, which also reveals how stable the model is.
Types of Cross-Validation
- K-fold: split the data into K equal folds (five or ten is conventional), train on K−1 of them, test on the remainder, and repeat K times with a different test fold each round.
- Stratified k-fold: the same rotation, but each fold preserves the dataset’s class proportions. This matters for imbalanced data, where a random fold might contain almost no examples of the rare class.
- Leave-one-out: K equals the number of data points, so each round tests on a single example. Thorough but expensive, and reserved for small datasets.
Time-ordered data needs a different scheme: train on the past, test on the future, and never shuffle. Randomly assigning a time series to folds lets the model peek ahead, a form of data leakage that inflates every score.
Example of Cross-Validation
A team evaluates a house-price model on 1,000 past sales using 5-fold cross-validation. They split the sales into five folds of 200, then run five rounds: train on 800, test on the held-out 200, record the error.
The five test errors come back close together and near the training error, so the model generalizes. If instead training error were low while all five test errors ran high, that gap would diagnose overfitting before deployment, when it is still cheap to fix. The same five-round loop, repeated per candidate configuration, drives hyperparameter tuning.
Related AI terms: Overfitting · Validation Set · Test Set · Model Evaluation · Learning Curve
Did you like the Cross-Validation gist?
Learn about 250+ need-to-know artificial intelligence terms in the AI Dictionary.
Mihail Sebastian — Writes about AI governance, regulation, and the technology behind them. Placeholder bio — replace with a real credential line. About