← Neural NetworksToolsInVisionLearning Center
Regression Loss Functions · Lesson 10

Mean Absolute Error

Measure average prediction distance without allowing signs to cancel.

Watch the lesson

Mean Absolute Error explained visually

2:25

Follow three delivery-time errors to understand absolute distance, averaging, and outlier resistance.

Lesson overview

What you will learn

Measure numerical prediction errors and compare MSE, MAE, and Huber loss.

  1. Remove the sign
  2. Average direct distances
  3. Reduce outlier influence
  4. Understand the tradeoff
01

Remove the sign

Absolute value turns early and late errors into positive distances so they cannot cancel.

02

Average direct distances

MAE adds absolute errors and divides by the number of examples while preserving the original unit.

03

Reduce outlier influence

Large errors grow in direct proportion to their size rather than being squared.

04

Understand the tradeoff

MAE has a sharp corner at zero, which makes its optimization behavior less smooth than MSE.

Knowledge check

Quick check: test your understanding

Why use absolute values?

To measure error size without positive and negative values cancelling.

What unit does MAE use?

The same unit as the predicted target.

How does MAE treat outliers?

More gently than MSE because it does not square their errors.

Accessible referenceLesson 10 transcript340 words · Matches the published narration and captionsOpen transcript

Mean Squared Error gives large mistakes a powerful penalty. Mean Absolute Error takes a simpler approach. Imagine checking how far several delivery drivers arrived from their promised times. One driver arrives five minutes early. Another arrives three minutes late. A third arrives ten minutes late.

Their signed errors are negative five, positive three, and positive ten minutes. If we add these numbers directly, early and late arrivals can cancel each other. That would hide the real size of the mistakes. Mean Absolute Error removes the sign from every error. Negative five becomes five. Positive three remains three. Positive ten remains ten.

Add them together and we get eighteen minutes. Divide by three deliveries, and the Mean Absolute Error is six minutes. This tells us that the predictions miss the true delivery time by six minutes on average. Unlike Mean Squared Error, Mean Absolute Error does not dramatically magnify large mistakes.

An error of ten contributes ten. An error of one hundred contributes one hundred. The second error is ten times larger and receives ten times the influence, not one hundred times the influence. This makes Mean Absolute Error more resistant to outliers. Return to our neighborhood of ordinary houses and one unusual mansion. The mansion can still affect the loss, but it is less likely to completely control the training process.

Mean Absolute Error is also easier to explain because it remains in the original unit. For delivery predictions, the result is measured in minutes. For house prices, it is measured in dollars. However, Mean Absolute Error has its own limitation. Near zero, its shape has a sharp corner. That can make optimization less smooth than Mean Squared Error.

Neither loss function is always best. Use Mean Squared Error when large mistakes should receive especially strong penalties. Consider Mean Absolute Error when unusual values exist and you want every error to contribute more directly. But what if we want smooth learning for ordinary errors and gentler treatment for outliers? In Lesson 11, we will combine both ideas using Huber loss.