Skip to content
AI360Xpert
Glossary
Definition

Nested Cross-Validation

Two nested loops: an inner one tunes a hyperparameter using only outer training rows, an outer one scores the chosen setting on rows the tuning never saw.

Tuning a hyperparameter and reporting its score against the same fold lets the search overfit the split — the setting that wins is partly the one that flukes that fold's noise, not the one that generalizes best. The gap between a naive and a nested estimate grows with the size of the search and shrinks with the amount of data.

Nested CV costs roughly the outer fold count times an ordinary search, and it buys an honest estimate rather than a model to ship; the deployed model is refit once, tuned by ordinary cross-validation on the full dataset.