Lesson 6.2 · 8 min read · about 50 min to master at a very slow pace
MSE, MAE and Asymmetric Losses
Regression losses compared: MSE punishes big errors hard and estimates the mean; MAE is robust to outliers and estimates the median; pinball losses price over- and under-prediction differently.
The regression losses
| Loss | Formula (average over ) | Property |
|---|---|---|
| MSE (L2) | Estimates the mean; large errors dominate | |
| MAE (L1) | Estimates the median; robust to outliers | |
| Pinball (asymmetric) | if , if , with | Different prices for over- and under-prediction |
Why MAE resists outliers
MSE's gradient is proportional to the error, so one huge residual can dominate the whole update. MAE's gradient has the same size (±1) however big the error, so a few outliers have limited pull. MAE isn't differentiable at exactly zero; a valid subgradient (any value in , usually 0) is used there.
Worked example: mean vs median
Targets . The single number that minimises MSE is the mean, 22. The one that minimises MAE is the median, 3. One outlier drags the MSE answer far from the typical value.
Asymmetric losses
When over-predicting and under-predicting cost different amounts (running out of stock versus holding extra), the pinball loss weights them differently: with and , under-predicting costs three times as much as over-predicting, so the model learns to aim high.
For any regression loss, use a linear output: a sigmoid would restrict the predictions to (0, 1).
Stuck? Common doubts
Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.
Going deeperIf MAE is more robust, why is MSE so common?
MSE is smooth everywhere, its gradient shrinks near the optimum (which helps convergence), and it matches the assumption of Gaussian noise. MAE is preferable when the data has outliers you don't want to chase. Many practitioners use a hybrid (the Huber loss) that is quadratic near zero and linear far away.
Cheatsheet
MSE vs MAE
Pinball loss
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.