liveBook · Manning

Mean absolute error

As explained in Machine Learning System Design

The arithmetic mean of the absolute differences between predictions and actual values.

A forecast can look accurate on average and still lead to poor inventory decisions. Mean absolute error (MAE) summarizes the size of prediction errors: take the absolute difference between each prediction and actual value, then average those differences. It can serve as a regression loss during training or as a metric for assessing forecasts, but its convenience is not a reason to choose it by default. section 5.1 section 5.3.1

What prediction does MAE favor? Minimizing absolute error favors the median rather than the mean. The distinction may matter little for a symmetric predictive distribution. For low-volume product counts, however, predictive distributions are often far from symmetric, so an MAE-optimized point forecast can be biased for the planning task. section 5.3.1

Choose the measure before training

In a cryptocurrency exchange-volume prediction project, a design document listed performance metrics without explaining the choice of loss function. That omission leaves an important question unanswered: does the training objective reward the kind of predictions the system actually needs? section 5.1

Before settling on MAE, check what the decision requires:

  • Compare the target prediction. MAE favors the median; minimizing squared error favors an unbiased point forecast, but mean squared error is sensitive to very high forecast errors. section 5.3.1
  • Check whether a scaled measure is more useful. Weighted mean absolute percentage error divides MAE by the mean out-of-sample realization; mean absolute scaled error divides it by the in-sample MAE of a random-walk forecast. section 5.3.1
  • For supply-chain planning with low-count demand, ask whether any point-error measure is enough. Inventory control can require the full discrete predictive distribution, not just a point forecast. section 5.3.1

Use MAE when the absolute size of errors and its median-seeking behavior fit the decision. Record that reasoning alongside the metric choice; changing the loss can help, but no single loss function fixes every modeling problem. section 5.1 section 5.3.1

How Machine Learning System Design covers it

How deep it goes
Explains MAE through its median-seeking behavior and metric comparisons, without deriving formulas or implementing a training pipeline.
Examples
Uses a cryptocurrency exchange-volume design decision and low-volume retail demand forecasts to expose metric-selection tradeoffs.
What you can do after
Evaluate/understand whether MAE’s median-seeking behavior suits a forecasting goal or whether another measure or a full predictive distribution is needed.
How it connects
Connects MAE to mean squared error, weighted mean absolute percentage error, mean absolute scaled error, and predictive distributions.

Also explained in

Compare how 10 books explain mean absolute error →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.