Mallows' Cp Corrects Training Error for Overfitting
Mallows' Cp estimates test error by adding a penalty of 2dσ̂² to the training residual sum of squares, so bigger models must earn their extra predictors. James, Witten, Hastie, and Tibshirani motivate it in Section 6.1.3 of An Introduction to Statistical Learning: "the model containing all of the predictors will always have the smallest RSS and the largest R²," so those cannot pick a model size. Then: "For a fitted least squares model containing d predictors, the Cp estimate of test MSE is computed using the equation Cp = (1/n)(RSS + 2dσ̂²), where σ̂² is an estimate of the variance of the error ε associated with each response measurement." They add that "Typically σ̂² is estimated using the full model containing all predictors."
What the penalty does: "Essentially, the Cp statistic adds a penalty of 2dσ̂² to the training RSS in order to adjust for the fact that the training error tends to underestimate the test error." And the selection rule: "when determining which of a set of models is best, we choose the model with the lowest Cp value." A footnote warns about labels: "Mallow's Cp is sometimes defined as C′p = RSS/σ̂² + 2d − n. This is equivalent to the definition given above in the sense that" the model with the smallest Cp "also has smallest C′p." They also note that "if σ̂² is an unbiased estimate of σ² in (6.2), then Cp is an unbiased estimate of test MSE."
Try it by hand. I generated 12 invented points with a fixed random seed: four candidate predictors, a response that truly depends on the first two plus noise. The nested models use 0, 1, 2, 3, and 4 predictors. The training RSS values, rounded to two decimals, are 90.75, 12.90, 8.64, 8.59, and 7.60, which never rise as predictors are added, as the book says. All scores below were computed from the unrounded fits and then rounded. The full model has 7 residual degrees of freedom, so σ̂² = 7.60 / 7 ≈ 1.086. Then Cp = (RSS + 2dσ̂²) / 12 gives 7.56, 1.26, 1.08, 1.26, and 1.36 for d = 0 to 4. The lowest is 1.08 at d = 2, which is the true model. The footnote's form C′p = RSS/σ̂² + 2d − 12 gives 71.59, 1.89, −0.05, 1.92, and 3.00. The numbers differ completely, yet the minimum is again at d = 2. Now the trap. Keep the same RSS values but plug in a different variance estimate. With σ̂² = 0.01 the penalty almost vanishes and Cp picks d = 4, the largest model. With σ̂² = 10 it picks d = 1. The ranking is only meaningful when the same sensible σ̂² is used for every model. On six more seeds the same procedure picked 2 predictors five times and 3 predictors once, so it is a sensible guide and not a guarantee. The data are invented, and the code ran with NumPy.
The trap: treating every number called Cp as comparable, or any variance estimate as good enough. Definitions differ in scale, as the footnote shows, and the penalty is only calibrated when σ̂² is a good estimate of the error variance. A caution of my own, not from the section I read: the book's d counts predictors and excludes the intercept, and the scores shown here are valid for ranking these models. The literal claim that Cp is an unbiased estimate of test MSE needs every fitted parameter counted, including the intercept. With p = d + 1, each C′p score gains 2 and each MSE-scale score gains 2σ̂²/n, the same amount for every model, so the ranking and the winner do not change. Cp also assumes the least squares setting the book describes.
Prof Rod's rule: compare Cp only across models scored with one definition and one error-variance estimate, and pick the lowest, remembering it is an estimate.