Cross-validation estimates predictive performance by repeatedly fitting on one part of the data and evaluating on held-out observations. In K-fold cross-validation, divide training data into disjoint folds ; identifies observation 's fold, and is fitted without fold . The displayed average scores each observation using a rule that did not train on it. Weight by observation count when fold sizes differ. Leave-one-out cross-validation uses one observation per fold. [ref]
https://web.stanford.edu/~hastie/ISLR2/Slides/Ch5_Resampling_Methods.pdf. ISLR chapter 5 slides, resampling methods
For the training error example, three folds contain indices with equal remainder modulo 3. Each fit uses eight observations. The squared-error loss averages for degrees 1, 2, and 7 are , , and respectively. Select degree 2 and refit on all twelve training data observations. The folds reuse scarce data while challenging each candidate to predict unseen responses; they do not touch the final test set.
Any learned preprocessing, including variable selection, must also be fitted within each training fold to avoid data leakage. [ref]
https://web.stanford.edu/~hastie/ISLR2/Slides/Ch5_Resampling_Methods.pdf. ISLR chapter 5 slides, the wrong and right way
Repeated tuning can itself overfit the cross-validation score; nested cross-validation uses inner folds for model selection and outer folds for assessment of that entire procedure. [ref]Folds use fewer training observations than the final refit, and their scores are dependent because training observations overlap. [ref]
https://web.stanford.edu/~hastie/ISLR2/Slides/Ch5_Resampling_Methods.pdf. ISLR chapter 5 slides, correlated fold estimates
Splitting must match deployment: for time series forecasting, rolling-origin cross-validation trains on the past and evaluates later observations, preventing future information from entering a forecast. Ordinary random folds need not answer that forecasting question. [ref]Nested cross-validation separates selection from assessment using two levels of held-out data. Within each outer training fold, inner cross-validation chooses a model or tuning parameters; the complete selected fitting procedure is then applied to that outer training fold and scored on its untouched outer evaluation fold. This estimates the performance of the model selection procedure, including its choices, rather than reusing its best inner score as an assessment. A final model can then be selected and fitted using all available training data. [ref]
https://jmlr.org/papers/v11/cawley10a.html. Cawley and Talbot, selection bias and performance evaluation
Subtract the diagonal variance contribution from the derivative estimate's squared norm, then insert the result into asymptotic mean integrated squared error. The expected curvature estimate equals , apart from a negligible finite-n term. This makes the resulting criterion asymptotically correct even though it is not an exactly unbiased estimate of integrated risk. Under standard conditions its selector is ratio-consistent with the optimal bandwidth and has relative fluctuation order .
Minimize the displayed criterion using a Leave-one-out cross-validation estimate in the second term. Its expectation is the exact mean integrated squared error minus , which does not depend on h. With standard smoothness and appropriate search ranges, the chosen bandwidth is asymptotically optimal. Its relative fluctuations are ordinarily of order , considerably larger than the estimation error achievable by well-chosen plug-in pilots.
For a fixed linear smoother, generalized cross-validation replaces the individual leverage corrections of Leave-one-out cross-validation by their average. It selects smoothing parameters by minimizing the displayed criterion. It approximates a predictive error criterion; it is not a universal exact estimate of future error and requires care when observation errors are dependent.
Leave-one-out cross-validation performs one fit with each observation held out in turn and averages the held-out losses.
If a linear smoother has fitted vector , its residual after fitting without observation isThe identity follows from a block matrix inverse or a rank-one inverse update.
K-fold cross-validation partitions observations into folds, trains times while holding out one fold at a time, and combines the held-out losses.
Articles by others on the same topic
There are currently no matching articles.