← Lessons

quiz vs the machine

Gold1400

Machine Learning

The R Squared Metric

How much variance your regression model actually explains.

5 min read · core · beat Gold to climb

What it measures

R squared, the coefficient of determination, reports the fraction of the variance in the target that the model explains. It compares the model error against the error of a baseline that always predicts the mean.

  • One means the model explains all the variance.
  • Zero means it does no better than predicting the mean.
  • Below zero means it does worse than that baseline.

How to read it

R squared is unitless, which makes it handy for comparing models on the same dataset. Unlike RMSE it does not carry the scale of the target, so a value of point eight reads the same whether you predict dollars or grams.

Cautions

R squared has traps. Adding any feature can only raise it on training data, even a useless one, so it rewards complexity. Adjusted R squared counters this by penalizing extra features. R squared also says nothing about whether predictions are biased or whether the model fits a curved relationship, so always pair it with a residual plot.

Key idea

R squared reports the fraction of target variance the model explains versus a mean baseline, and adjusted R squared corrects its bias toward rewarding extra features.

Check yourself

Answer to earn rating on the learn ladder.

1. What does an R squared of zero mean?

2. Why does adjusted R squared exist?