Regression & Predictive Modeling

Cross-validation

Cross-validation is a smarter way to estimate how well a model will generalize, especially when data is limited. In the popular k-fold version you split the data into k equal parts, then train on k−1 of them and test on the one left out, rotating until every part has had a turn as the test fold, and average the scores.

The advantage over a single split is that every data point is used for both training and testing (at different times), giving a more stable, less luck-dependent estimate of performance and tighter tuning of settings like the regularization strength. The cost is computation — you fit the model k times — and you must still keep a truly final test set untouched if you also use cross-validation to choose between many models.

Also called
k-fold cross-validation