Data being divided, representing cross-validation.

Testing a model more reliably by rotating the test data.

What cross-validation is

Cross-validation is a technique for estimating how well a machine learning model will perform on new, unseen data. Instead of testing the model just once, it repeatedly splits the data into parts, trains the model on some parts, and tests it on the others, rotating which parts are used for testing. Averaging the results gives a more reliable picture of the model's true performance.

Why testing once is not enough

If a model is tested on just one fixed portion of data, the result can depend heavily on which data happened to be chosen. A lucky or unlucky split could make the model look better or worse than it really is. Cross-validation reduces this problem by testing on several different splits, so the performance estimate is less dependent on any single division of the data.

How cross-validation works

A common form of cross-validation divides the data into several equal parts. The model is trained on all but one part and tested on the part left out, and this is repeated so that each part serves as the test set once. The results from all these rounds are then combined, usually by averaging, to produce an overall estimate of how well the model performs.

Detecting overfitting

Cross-validation also helps reveal overfitting, which happens when a model performs well on the data it was trained on but poorly on new data. By repeatedly testing on data the model did not train on, cross-validation gives a clearer sense of how the model generalizes. A model that does well in cross-validation is more likely to perform well in the real world, not just on its training data.

Why cross-validation is valuable

By providing a more trustworthy estimate of performance, cross-validation helps in comparing models and choosing settings. It makes better use of limited data, since every data point gets used for both training and testing across the rounds. This reliability is why cross-validation is a standard practice when evaluating machine learning models and deciding which approach works best.

Why it matters

Cross-validation is a key technique for honestly judging how good a machine learning model is. Understanding what cross-validation is - rotating which data is used for testing to get a reliable performance estimate - clarifies how practitioners avoid being misled by a single lucky split. For anyone working with machine learning, it is an important concept.

See also: What is overfitting in machine learning?, What is training data? Explained.

Sources

Published date reflects the original event date (2023-12-12). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.

Skillo Staff

Skillo Staff

All stories by: Skillo Staff

Leave a Reply