Leave-one-out evaluates one excluded observation at a time. In least squares, a leverage correction recovers those predictions from a single fit. Generalized cross-validation replaces individual leverages with their average.
A direct implementation fits n models on n−1 observations each. For a fixed algorithm under iid sampling, its expected score is Errn−1. This is often close to Errn when the learning curve changes slowly; it is not exactly unbiased for the full-data model’s error.
The numerator uses ordinary full-fit residuals; the denominator corrects for using the observation in its own fit. hii is leverage, determined by the design. High leverage can amplify a small residual, but leverage alone is not a complete measure of influence.
Derivation via Sherman-Morrison
Write M=X⊤X, hi=xi⊤M−1xi, and ei=Yi−xi⊤β. Removing row i gives
The identity is exact for the specified OLS refits, and for certain penalized least-squares smoothers with the appropriate fixed penalty convention. Merely writing Y=HY for an arbitrary full-data linear map is not sufficient: the rule after deletion must have the required relationship to the full fit.
It also does not automatically reproduce a pipeline that repeats feature selection, changes the basis, or retunes a penalty after each deletion. If hii=1, the displayed OLS shortcut is undefined and the deleted design loses rank.
Deleting an endpoint leaves a line fitted through the other two points. Predicting the excluded endpoint is extrapolation, which explains the large LOO errors despite modest training residuals.
For OLS, df=p. Compute the trace without forming the full n×n hat matrix. The same idea applies to regularized smoothers with noninteger effective degrees of freedom.
LOO
GCV
Corrects each residual using its own leverage.
Uses a common average-leverage correction.
Exact OLS deleted-fit score when the conditions hold.
Approximation to LOO, not literal leave-one-out refitting.
Can be dominated by individual high-leverage cases.
Removes individual leverage denominators, but may hide their effect.
which differs from LOO’s value of 3. If all leverages are equal, the two formulas agree. When df approaches n, the GCV denominator becomes small; at df =n the score is undefined.
Why GCV Is Invariant to Orthogonal Rotation
For a fixed linear smoother, transform the observation coordinates using Q⊤Q=QQ⊤=I:
Both parts of GCV are unchanged. Individual diagonal entries of H∗ need not equal those of H, so the corresponding coordinate-wise LOO expression can change. For OLS, this smoother transformation follows from X∗=QX.
This is an algebraic motivation for GCV. Rotating rows mixes observations and changes what it means to omit one observation; it does not make the original LOO assessment invalid.
In correctly specified fixed-design Gaussian OLS, β is independent of e=(I−H)Y. The LOO score with fixed leverages is a function of e, while the fitted coefficients depend on the projected component HY.
This explains an important distinction: an error score need not track how fortunate or unfortunate this particular coefficient estimate was. Estimating average performance across training samples is different from closely predicting the conditional error of one realized fit.