liveBook · Manning

Mean absolute error

As explained in Deep Learning with Python, Third Edition

The average absolute difference between predictions and numeric targets, used as a regression error metric.

Mean absolute error (MAE) measures how far predictions miss numeric targets on average. It takes each prediction–target difference, ignores its sign, and averages the absolute values. Unlike accuracy, it fits regression because the result stays in the target’s units. section 4.3.3 section 4.3.6

Reading an MAE value

Suppose house-price targets are scaled by 100,000. An MAE of 0.5 means predictions are off by $50,000 on average. In a temperature forecast, a validation MAE of 2.44 means the predictions miss by 2.44°C on average. section 4.3.3 section 13.2.2

Use MAE to monitor regression quality even when mean squared error is the training loss. In K-fold validation, average the fold scores rather than trusting one split; four folds produced scores from 0.232 to 0.349, averaging 0.296. Plotting validation MAE across epochs can reveal when improvement stops and overfitting begins. section 4.3.3 section 4.3.4

np.mean(np.abs(preds - targets))

The NumPy expression directly implements MAE as the mean of absolute prediction errors. section 13.2.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Defines absolute prediction error, demonstrates target-scale interpretation, and applies fold averaging and epoch plots without deriving optimization behavior.
Examples
Uses house-price regression, four-fold validation, temperature persistence forecasting, and an LSTM temperature model.
What it assumes
Assumes numeric prediction targets and introduces regression-specific evaluation separately from classification accuracy.
What you can do after
Evaluate regression and forecasting models with MAE, interpret scores in target units, and identify validation improvement or overfitting.
How it connects
Connects MAE with regression, mean squared error, K-fold cross-validation, overfitting, and baseline evaluation.

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 Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.