Skip to main content
Albero Academy

Regression Metrics

Measure regression quality with MAE, RMSE and R².

Regression8 min

A model is only as good as its evaluation. For regression, three metrics answer "how wrong are the predictions?" in different, complementary ways.

The three you need

MetricMeaning
MAEMean absolute error — average |error|, in target units
RMSERoot mean squared error — penalises big errors more
R²Fraction of variance explained (1 = perfect, 0 = no better than the mean)
computing them
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
pred = model.predict(X_test)
mean_absolute_error(y_test, pred)
mean_squared_error(y_test, pred, squared=False) # RMSE
r2_score(y_test, pred)

Key takeaways

  1. 01MAE = average absolute error in target units — intuitive and outlier-robust.
  2. 02RMSE penalises large errors more — use when big misses matter most.
  3. 03R² is the fraction of variance explained (1 perfect, 0 = mean baseline).
  4. 04Always evaluate on the held-out test set, not training data.

Finished this chapter?

Mark it complete to track your progress through Scikit-learn.