What is the difference between MAE and RMSE as regression metrics?
MAE is the average absolute error and treats all errors equally. RMSE squares errors before averaging and takes the root, so large errors count much more. RMSE is always at least as large as MAE.
Explain it simply
Both give the typical size of the prediction error in the same unit as the target (rupees, minutes, marks).
- MAE adds up how far off each prediction was, ignoring direction, and averages. An error of 10 counts as ten times an error of 1.
- RMSE squares each error first, so an error of 10 counts as a hundred times an error of 1. It punishes big misses harshly.
Example
Five delivery-time predictions with errors (in minutes) of 2, -3, 1, -2 and 10.
- MAE = (2 + 3 + 1 + 2 + 10) / 5 = 3.6
- RMSE = sqrt((4 + 9 + 1 + 4 + 100) / 5) = sqrt(23.6) = 4.86
If all errors were 3 (signs flipping), MAE and RMSE would both be exactly 3. The gap between RMSE and MAE signals that a few errors are large.
import numpy as np
e = np.array([2, -3, 1, -2, 10])
print(np.abs(e).mean()) # 3.6
print(round(np.sqrt((e ** 2).mean()), 2)) # 4.86What to say in the interview
"MAE is easy to explain and robust to outliers. RMSE penalises large errors, so I use it when big misses are especially costly, such as underestimating demand for a perishable item. I look at both, and a large gap between them tells me errors are concentrated in a few points."
Common mistakes
- Comparing the RMSE of two models measured on different target scales.