AI Dictionary › Fondamenti AI

Cross-validation

Cross-validation is a technique for estimating how well a machine learning model will generalize to unseen data, without having to sacrifice a large portion of the dataset to a single test. Instead of splitting the data into training and validation just once, it splits it multiple times in different ways and averages the results, producing a far more reliable estimate of the model's real performance.

Definition

What it is

Cross-validation is a technique for estimating how well a machine learning model will generalize to unseen data, without having to sacrifice a large portion of the dataset to a single test. Instead of splitting the data into training and validation just once, it splits it multiple times in different ways and averages the results, producing a far more reliable estimate of the model's real performance.

How it works

The most common variant is k-fold cross-validation: the dataset is divided into k equally sized parts, called folds. On each round a different part is held out as the test set, the model trains on the remaining k-1 parts, and performance is measured on the one left out. Repeating the procedure k times means every observation ends up in the test set exactly once, and the average of the k performance scores is the final estimate, along with its variability, valuable information that a single train-test split would not provide.

Applications

It is an essential tool for fairly comparing different models, choosing the best hyperparameters, and checking that a model did not simply get lucky with one particular data split. It matters especially with small datasets, where a single test set risks giving an unstable and unreliable estimate of real performance. Variants such as stratified k-fold preserve class proportions in every fold, which is useful with imbalanced data.

History & etymology

The term cross-validation appears in the statistical literature starting in the 1930s, but it spread mainly from the 1960s and 70s onward through the work of statisticians such as Seymour Geisser and Mervyn Stone, who formalized its use for model selection. The name literally describes the central idea: validating the model by repeatedly crossing the roles of training and testing across the different portions of the data, instead of fixing them just once.

Definizione (italiano)

La cross-validation, o convalida incrociata, è una tecnica per valutare quanto un modello di machine learning generalizzerà su dati mai visti, senza dover sacrificare una grande porzione del dataset a un unico test. Invece di dividere i dati una sola volta in addestramento e verifica, li divide più volte in modi diversi e media i risultati, ottenendo una stima molto più affidabile delle prestazioni reali del modello.

La variante più diffusa è la k-fold cross-validation: il dataset viene suddiviso in k parti di uguale dimensione, dette fold. A ogni turno una parte diversa viene tenuta da parte come test, il modello si addestra sulle restanti k-1 parti, e si misura la prestazione su quella lasciata fuori. Ripetendo il procedimento k volte, ogni osservazione finisce esattamente una volta nel test, e la media delle k prestazioni ottenute è la stima finale, accompagnata dalla sua variabilità, un'informazione preziosa che un singolo split addestramento-test non fornirebbe.

È uno strumento indispensabile per confrontare in modo equo modelli diversi, scegliere i migliori iperparametri e verificare che un modello non abbia semplicemente avuto fortuna con una particolare divisione dei dati. È particolarmente importante con dataset piccoli, dove un singolo test set rischierebbe di dare una stima instabile e poco affidabile delle prestazioni reali. Varianti come la stratified k-fold mantengono le proporzioni delle classi in ogni fold, utile con dati sbilanciati.

Il termine cross-validation compare nella letteratura statistica a partire dagli anni '30, ma si diffonde soprattutto dagli anni '60 e '70 con i lavori di statistici come Seymour Geisser e Mervyn Stone, che ne formalizzarono l'uso per la selezione dei modelli. Il nome descrive letteralmente l'idea centrale: validare il modello incrociando più volte i ruoli di addestramento e verifica tra le diverse porzioni dei dati, invece di fissarli una sola volta.

Related terms

More in Fondamenti AI

Put it into practice

From our network

AGORÀ Intelligence — Enterprise AI Governance Platform

Govern AI at scale: policies, adoption and measurable results on your data. Built for boards and C-suite.

Visit agora-intelligence.com →

From the Agora Intelligence blog

More on agora-intelligence.com →

📱 Download the Android app (beta) iOS coming soon

Say what you mean. Get what you need.

Grace Certified — the AI coach that trains and certifies your prompt engineering — by Agora Intelligence.