# Cross-Validation

> You test a model many times, each on a new slice of the data. Then you take the average.

**Field:** Artificial Intelligence  
**Category:** Evaluation & Benchmarks  
**Also known as:** K-Fold Cross-Validation, K-Fold CV

## Think of it like

It is like having five friends taste a cake. One opinion could be luck, but five is fair.

## Definition

Cross-validation is a way to test a model several times on different parts of the data, for a fairer score. The data is split into equal parts, often 5 or 10, called folds. The model is trained on all but one fold and tested on the one left out. This repeats until each fold has been the test once. The scores are then averaged, which also shows how much the result depends on luck.

## Example

Jack has only 600 labeled photos. With 5-fold cross-validation, he trains five times, each time testing on a different 120 photos, and gets scores from 84% to 89%.

## Why it matters

One test split can be lucky or unlucky. Cross-validation shows the real score and how much it moves.

## Common mistake

Tuning settings on the same folds you report. Keep a final test set apart that the model never touched.

## Three principles

- **Split into folds.** Often 5 or 10.
- **Each fold tests once.** The rest train.
- **Average the scores.** Less luck.

## Related terms

- [Validation Set](https://learn.benibix.com/term/ai/validation-set)
- [Test Set](https://learn.benibix.com/term/ai/test-set)
- [Overfitting](https://learn.benibix.com/term/ai/overfitting)
- [Model Evaluation](https://learn.benibix.com/term/ai/model-evaluation)

![Five rows, each splitting the data into five folds. In each row a different fold is the test, and the five scores are averaged at the end.](https://learn.benibix.com/diagrams/ev-cross-validation.svg)

---

Source: https://learn.benibix.com/term/ai/cross-validation
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
