
📊 Is your regression model any good? R² tells you at a glance.
The coefficient of determination (R²) measures the proportion of the variation in your target variable that is explained by your model’s input variables.
How to interpret it:
- R² = 1.0 → The model explains 100% of the variation. Perfect fit.
- R² = 0.8 → The model explains 80%. Pretty good.
- R² = 0.0 → The model explains nothing beyond just using the mean.
- R² < 0 → ⚠️ The model is worse than using the mean. Something is wrong.
The formula:
$$R^2 = 1 - \frac{SS_{res}}{SS_{tot}}$$Where $SS_{res}$ is the sum of squared residuals and $SS_{tot}$ is the total variation.
⚠️ Watch out:
- High R² doesn’t guarantee a good model: overfitting is possible
- Don’t use it to compare models with different numbers of variables (use adjusted R²)
- Not directly applicable to non-linear models
💡 Explanation in a nutshell#
Imagine you want to predict house prices. If you always said “the average price,” you’d have some error. R² measures how much better your model is compared to that basic prediction. R² = 0.85 means your model reduces error by 85% compared to just guessing the average.
More information at the link 👇
Also published on LinkedIn.
