Skip to content
Quantoros

A holdout R² is -0.4. Does this imply a programming error?

Classic MLLevel: IntermediateNegative R-squared

A holdout R² is -0.4. Does this imply a programming error?

Hints
  • R² compares against a constant baseline.
  • Out-of-sample performance is not constrained above that baseline.

Answer

No. Predictions can have more squared error than predicting the holdout target mean, yielding negative R². Investigate generalization and distribution mismatch rather than clipping the metric.

Source and licence: scikit-learn 1.7.2 — model evaluation · BSD-3-Clause · answer: Quantoros editorial

Related questions