Regression✓ Mathematical
◆ The PatternMAE, RMSE, R² — which metric for which problem and what the numbers actually mean
Regression metrics measure how far predictions are from truth. MAE treats every error equally, RMSE penalises big errors more, and R² tells you how much variance your model explains vs a baseline mean prediction.
MAE = (1/n) · Σ |yᵢ − ŷᵢ|
MAE = average absolute error. Robust to outliers, interpretable in target units.
RMSE = √((1/n) · Σ (yᵢ − ŷᵢ)²)
RMSE = penalises large errors disproportionately. Same units as target.
R² = 1 − SSres / SStot
R² = fraction of variance explained. 1 = perfect, 0 = no better than predicting the mean.
// Interactive — drag points, see metrics update
Noise0.30
MAE—
RMSE—
R²—
# Python — regression metrics from sklearn.metrics import ( mean_absolute_error, mean_squared_error, r2_score ) mae = mean_absolute_error(y_true, y_pred) rmse = mean_squared_error(y_true, y_pred, squared=False) r2 = r2_score(y_true, y_pred) print(f"MAE: {mae:.3f} RMSE: {rmse:.3f} R²: {r2:.3f}")
Adjusted R²: R²adj = 1 − (1−R²)(n−1)/(n−p−1). Penalises adding features. Always use adjusted R² when comparing models with different feature counts.