EasyDeepLearn

Can R2R^{2} be negative? What does that mean?

medium

Answer

  • Yes. R2=1SSresSStotR^{2} = 1 - \frac{SS_{\mathrm{res}}}{SS_{\mathrm{tot}}} compares your model's residual sum of squares to that of a constant-mean baseline.
  • A negative R2R^{2} on a test set means your model is worse than predicting the mean everywhere — usually a sign of severe overfitting or distribution shift.
  • On the training set with intercept, R2R^{2} is always in [0,1][0, 1]; the negative case only appears on held-out data or intercept-free fits.
Check yourself — multiple choice
  • No, R2R^{2} is always between 0 and 1
  • Yes; negative test R2R^{2} means the model is worse than predicting the mean
  • Negative R2R^{2} means the correlation is negative
  • Negative R2R^{2} is a bug in scikit-learn

On held-out data, R2R^{2} can go below 0 — the model is worse than the mean baseline.

#linear-regression#metrics-regression

Practise Supervised Learning

215 interview questions in this topic.

Related questions