For true values and linear-regression predictions (fitted with feature), what are and adjusted , how can test-set become negative, and why does adding a pure-noise feature never reduce training whereas adjusted penalises it?
ML systems and evaluation, Regression metrics
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you understand the variance-explained formula for , its out-of-sample behaviour, and the degrees-of-freedom penalty in adjusted .
Key idea
compares a model’s squared error against predicting the sample mean ; adding a feature never increases training , while (for examples and features excluding the intercept) divides by residual degrees of freedom so a new feature improves only if its error drop outweighs losing a degree of freedom.
Steps
- Compute , total sum of squares , and residual sum of squares .
- Compute , and adjusted for : .
- Explain negative : on a test set (or for a model without an intercept, or a poor non-linear model), predictions can be worse than simply predicting , making and .
- Explain adding noise features: OLS can always set the new weight to , so training can only stay flat or drop (meaning training is monotonically non-decreasing in ), whereas increases only if the drop in outweighs the loss of one degree of freedom in .
Common mistakes
- Saying must always lie in ; that only holds on training data for OLS regression with an intercept.
- Equating with the square of Pearson correlation between and in general; holds for training OLS with an intercept, not on test sets or regularised models.
How long your answer should be
Three lines of arithmetic and 4–5 sentences; 4 minutes.
Last checked on 4 December 2026.
Read this
Previous in ML systems and evaluation: A calibrated fraud model outputs . Missing a fraud costs ₹10,000 and flagging a legitimate transaction costs ₹1,000 in review effort. Derive the cost-minimising threshold. What would you do if the model were not calibrated?
Next in ML systems and evaluation: A student standardises features and applies PCA on the full dataset before running 5-fold cross-validation, obtaining 92% accuracy, whereas fitting both inside each fold yields 81%. Why does the first setup leak information, how does a pipeline fix it, and why is supervised feature selection before CV even more damaging?