R² measures explained variance — but always increases when you add predictors. Adjusted R² penalises complexity: it only improves if a new predictor earns its place.
The coefficient of determination R² answers: how much better is our model than just predicting the mean? It decomposes total variance into explained and unexplained parts.
R² = 1 - SSres / SStot, where SStot = Σ(yi - ŷ)² is total variance and SSres = Σ(yi - ŷi)² is unexplained variance. R² = 0 means the model predicts only the mean. R² = 1 means perfect prediction. R² can be negative for models that perform worse than the mean baseline.
R² never decreases when predictors are added — even if you add random noise as a feature. This makes it a poor metric for comparing models with different numbers of predictors.
Advertising dataset example: TV alone gives R² = 0.61. Adding radio jumps to R² = 0.897 — radio genuinely helps. Adding newspaper gives R² = 0.897 — almost identical. But R² still increases by a tiny amount. Without a penalty, you might keep newspaper just because it technically raised R².
Why this happens
When a predictor is added, OLS optimises the coefficients to reduce SSres. Even a random predictor has some accidental correlation with the target in the training sample. SSres can only decrease, so R² can only increase. The fix is to penalise the degrees of freedom consumed.
Adjusted R² accounts for the number of predictors d and sample size n. It increases only if the new predictor improves the model more than expected by chance.
R²adj = 1 - (SSres/(n-d-1)) / (SStot/(n-1)) = 1 - (1-R²)(n-1)/(n-d-1). As d increases with n fixed, the penalty (n-d-1) shrinks the denominator, making the fraction larger and R²adj smaller — unless SSres drops enough to compensate.
Adding newspaper raised R² but lowered adjusted R² — correctly identifying it as useless.
R² is useful for communicating model quality to non-technical audiences, but practitioners also look at error-scale metrics.
Say the answer out loud before revealing — recalling is what makes it stick. ➜ Next: Elastic Net
What do SS_res and SS_tot represent in the R² formula?
Why does R² always increase (or stay flat) when features are added?
How does Adjusted R² fix the R² inflation problem?
When would you prefer RMSE over R² for model evaluation?