Cross-validation: what does it estimate and how well does it do it?

Stephen Bates, Trevor Hastie, Robert Tibshirani
4/1/2021
580 citations
stat.MEmath.STstat.CO

Official code: stephenbates19/nestedcv (46 stars, R, MIT, last commit 2022-06-10). 1 more implementation below.

Abstract

Cross-validation is a widely-used technique to estimate prediction error, but its behavior is complex and not fully understood. Ideally, one would like to think that cross-validation estimates the prediction error for the model at hand, fit to the training data.

Show full abstract

We prove that this is not the case for the linear model fit by ordinary least squares; rather it estimates the average prediction error of models fit on other unseen training sets drawn from the same population. We further show that this phenomenon occurs for most popular estimates of prediction error, including data splitting, bootstrapping, and Mallow's Cp. Next, the standard confidence intervals for prediction error derived from cross-validation may have coverage far below the desired level. Because each data point is used for both training and testing, there are correlations among the measured accuracies for each fold, and so the usual estimate of variance is too small. We introduce a nested cross-validation scheme to estimate this variance more accurately, and we show empirically that this modification leads to intervals with approximately correct coverage in many examples where traditional cross-validation intervals fail.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
stephenbates19/nestedcvOfficial46RMIT2022-06-10
stephenbates19/nestedcv_experimentsOfficial14RMIT2022-06-10
MIT

Nested cross-validation for accurate confidence intervals for prediction error.

4610RSep 7, 20204 years agoMIT
MIT

Numerical experiments for nested cross-validation paper

142RApr 5, 20214 years agoMIT

Similar Papers

Cite this paper

@article{bates2021crossvalidation,
  title  = {Cross-validation: what does it estimate and how well does it do it?},
  author = {Stephen Bates and Trevor Hastie and Robert Tibshirani},
  year   = {2021},
  eprint = {2104.00673},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.00673}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2104.00673.svg)](https://codeofpaper.com/paper/2104.00673)

Discussion