Regression Metrics Explained: MSE, RMSE, MAE, MAPE & R-Squared (R²)
How to score continuous predictions honestly — when to pick RMSE vs. MAE vs. MAPE, why R² can be negative, and why Adjusted R² beats plain R²
Regression metrics (MSE, RMSE, MAE, MAPE, R², Adjusted R²) quantify how close a model's continuous numeric predictions ŷ are to true values y.
Different business problems punish errors differently — RMSE heavily penalizes rare big misses, MAE treats every dollar of error equally, and plain R² falsely rises whenever you add useless random columns.
Picking the wrong regression metric optimizes the wrong business behavior — predicting the median (MAE) vs. predicting the mean (MSE) changes pricing and inventory decisions.
You must match your training loss (MSE vs. L1 vs. Huber) to your evaluation KPI (RMSE vs. MAE).
Stakeholders understand '$14,000 average error (MAE)' or '7.5% error (MAPE)' immediately — whereas 'MSE = 196,000,000 dollars²' means nothing to a CEO.
Guaranteed interview question: 'Can R² ever be negative? And why do we use Adjusted R² when comparing models with different feature counts?'
You are predicting daily product demand, and many products have 0 sales on slow days. Which metric will crash with a division-by-zero explosion?
- Compute MSE, RMSE, MAE, MAPE, R², and Adjusted R² from scratch.
- Choose RMSE when large outliers are catastrophic vs. MAE when every unit of error has equal cost.
- Explain why R² can actually be NEGATIVE on a test set (worse than predicting the constant mean!).
- Explain why MAPE explodes when true targets y approach zero.
Every regression metric asks a slightly different question: MAE asks 'How far off am I on a typical row?', RMSE asks 'How bad are my worst misses?', MAPE asks 'How far off am I in percent?', and asks 'How much better am I than just predicting the average every time?'
1. Side-by-Side Metric Decision Guide
| Metric | Units | Outlier Sensitivity | Optimal Constant Guess | When to Pick |
|---|---|---|---|---|
| MSE | Very High | Mean | Training loss (smooth gradient) | |
| RMSE | Same as | High | Mean | Big misses are disproportionately costly |
| MAE | Same as | Low (Robust) | Median | Every dollar/minute of error costs the same |
| MAPE | % | Medium (explodes at ) | — | Strictly positive targets () for exec reports |
| / Adj | Unitless | High | — | Scale-free comparison across datasets |
Four normal homes cost [$200k, $220k, $240k, $260k]. Drag the 5th home's price up to $2,000k and watch which loss function stays calm!
2. Plain R² vs. Adjusted R²
Plain never decreases when you add more training features — even pure random numbers! Adjusted fixes this by penalizing every extra feature : If a new column doesn't improve fit enough to earn its keep, Adjusted drops immediately.
The exact honest questions almost every beginner wonders — answered in plain English without hiding behind jargon.
Yes! On a validation/test set (or a bad model without an intercept), if your model's squared error is larger than simply predicting the constant mean , then .
Watch Gradient Descent Tilt & Slide the Line Down the MSE Bowl
Left: live fitted line & crimson residual errors. Right: real-time MSE descent curve!
import numpy as np
# Compute MSE, RMSE, MAE, MAPE, R² and Adjusted R² from scratch
y_true = np.array([100.0, 200.0, 300.0, 400.0, 500.0])
y_pred = np.array([110.0, 190.0, 285.0, 420.0, 560.0])
N, p = len(y_true), 2
err = y_true - y_pred
mse = float(np.mean(err ** 2))
rmse = float(np.sqrt(mse))
mae = float(np.mean(np.abs(err)))
mape = float(np.mean(np.abs(err / y_true)) * 100.0)
r2 = float(1.0 - np.sum(err ** 2) / np.sum((y_true - y_true.mean()) ** 2))
adj_r2 = 1.0 - (1.0 - r2) * (N - 1) / (N - p - 1)
print(f"RMSE={rmse:.2f} | MAE={mae:.2f} | MAPE={mape:.1f}% | R2={r2:.4f} | Adj_R2={adj_r2:.4f}")
sum(|y - ŷ|) / sum(|y|)) or MAE/RMSE when true targets can be zero.