Mean Absolute Error (MAE) Loss
When you predict a number—like a house price or tomorrow’s demand—you need a way to score how far off you were. Mean Absolute Error (MAE) loss does this in a very human way: it measures the average size of your mistakes, ignoring whether you were too high or too low.
What MAE measures
For each example, MAE takes the absolute error between the true value y and the prediction ŷ, then averages across the dataset:
MAE = (1/n) * Σ |yᵢ − ŷᵢ|
The absolute value is the key: a +10 and a −10 error both count as 10. Because errors grow linearly, MAE doesn’t let a few huge misses dominate the score the way squared-error losses do.
Why it matters in training and evaluation
Choosing MAE changes what a model “cares about.” Minimizing MAE pushes predictions toward the median of the target distribution (conditional on the features), which makes it naturally more robust to outliers than MSE. The tradeoff is that MAE has a sharp corner at zero error (it’s not differentiable there), so gradient-based optimization uses subgradients and can converge a bit less smoothly than with MSE.
Practical examples
- House price prediction: a few luxury homes can be extreme outliers; MAE keeps them from overpowering typical homes.
- Demand forecasting: if you care about “average units off” in a straightforward way, MAE matches the business intuition.
- Medical measurements (e.g., predicting lab values): MAE reports error in the original units, which is easy to interpret.
In scikit-learn you’ll see it as `mean_absolute_error`, and many libraries let you train with MAE directly (for example, Keras’s MeanAbsoluteError).
Mean Absolute Error (MAE) Loss is a regression objective that measures prediction error as the average of the absolute differences between true targets and model outputs: mean(|y − ŷ|). It penalizes errors linearly, making it less sensitive to large outliers than squared-error losses. MAE matters because it directly defines what “good” predictions mean during training and evaluation, and it aligns optimization with median-focused accuracy in noisy data.
Imagine you’re guessing the arrival time of a bus each day. Some days you’re off by 2 minutes, other days by 10. Mean Absolute Error (MAE) Loss is like taking all those “minutes off” numbers, ignoring whether you were early or late, and averaging them. It tells you, in plain terms, how far your predictions usually are from the truth.
In supervised learning, MAE is often used when predicting numbers like house prices or delivery times. It’s valued because it treats each mistake in a straightforward, even-handed way, without letting a few extreme misses dominate the score.