Notes

Mean Absolute Error (MAE)

When you build a regression model, you usually don’t just want to know whether it’s “good” or “bad”—you want to know how far off its predictions are in everyday units, like dollars, days, or degrees. Mean Absolute Error (MAE) answers that in a straightforward way.

What MAE measures

MAE is the average size of your prediction errors, ignoring whether the model over- or under-predicts. For each example, compute the absolute error (the absolute value of the residual): |y − ŷ|. Then average those absolute errors across all examples. Because it doesn’t square errors, MAE grows linearly: an error of 10 counts exactly twice as much as an error of 5.

Why it’s useful in practice

MAE is popular because it’s easy to interpret: it tells you the typical miss in the same units as the target.

  • House prices: MAE = 18,000 means predictions are off by about $18k on average.
  • Demand forecasting: MAE = 7 means you miss by ~7 units per time period.
  • Time-to-delivery: MAE = 1.2 means about 1.2 days off on average.

Compared with RMSE, MAE is less dominated by rare huge mistakes, which can be a feature when you care about typical performance more than punishing outliers.

How it affects model choices

Choosing MAE as your evaluation metric nudges you toward models that reduce typical error rather than focusing heavily on extreme misses. In scikit-learn you’ll see it as:

from sklearn.metrics import mean_absolute_error
mae = mean_absolute_error(y_true, y_pred)

One important caveat: MAE isn’t scale-free, so you compare MAE values only when the target variable (and its units) are the same.

Mean Absolute Error (MAE) is a regression metric defined as the average of the absolute differences between predicted and true target values: mean(|y − ŷ|). It measures typical prediction error in the same units as the target and weights all deviations linearly, making it less sensitive to large outliers than squared-error metrics. MAE matters because it provides an interpretable, robust objective for comparing models and tuning regressors.

Imagine you’re guessing the time it takes to get to work each day. Some days you’re off by 2 minutes, other days by 10. Mean Absolute Error (MAE) is a simple way to score how far off your guesses are on average—without caring whether you guessed too high or too low. It takes each mistake, turns it into a positive number (so “-10” becomes “10”), and then averages those mistakes.

In AI, MAE is used when a model predicts a number, like house prices, delivery times, or energy use. A lower MAE means the predictions are usually closer to reality.