Data Science & ML
Intermediate

Coefficient of Determination (R²)

Proportion of variance in the target explained by the model.

Formula

R2=1(yiy^i)2(yiyˉ)2R^2 = 1 - \frac{\sum(y_i-\hat{y}_i)^2}{\sum(y_i-\bar{y})^2}

Variables

y_iActual
\hat{y}_iPredicted
\bar{y}Mean of actual

Example

R² = 0.85 means 85% of variance is explained

Did You Know?

R² can be negative if the model is worse than predicting the mean.