Mean absolute error
Mean absolute error is the arithmetic mean of the absolute differences between corresponding predicted and reference numerical values.
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
Mean absolute error is the average absolute difference between predicted or imputed values and their reference values.
- How it is used
- Compares imputation and regression errors, guides hyperparameter optimization, and ranks alternative predictive solutions.
- How deep it goes
- Defines MAE through reconstruction and prediction comparisons without deriving its calculation.
- Examples
- Uses masked Airbnb NYC features, Tokyo Airbnb price predictions, Optuna trials, and an XGBoost-versus-fastai results table.
- What you can do after
- Evaluate/understand competing imputers and predictive models by comparing their average absolute errors.
Learn Generative AI with PyTorch
A loss metric that averages the absolute difference between predicted and target values, used here for image reconstruction.
- How it is used
- Measures pixelwise reconstruction, cycle-consistency, or noise-prediction error during image-model training.
- How deep it goes
- Defines absolute pixel differences and their average, then shows loss calculation inside a training loop without deriving optimization mathematics.
- Examples
- Uses paired 256 × 256 images, reconstructed handwritten digits, and predicted versus actual noise in flower images.
- What you can do after
- Apply it via PyTorch’s `l1_loss` to train a denoising U-Net against known injected noise.
Read how Learn Generative AI with PyTorch explains mean absolute error →
Time Series Forecasting Using Foundation Models
Mean absolute error is the average of the absolute differences between predicted and actual values.
- How it is used
- Uses average absolute forecast error to compare pretrained, fine-tuned, and data-specific forecasting approaches.
- How deep it goes
- Defines interpretation, explains robustness and equal error penalties, and demonstrates implementation, but does not derive the equation mathematically.
- Examples
- Demonstrates MAE on monthly and daily forecasts, retail sales, foundation-model cross-validation, and website-visitor model comparisons.
- What you can do after
- Evaluate via utilsforecast and compare forecasting models using an interpretable error score in the target’s units.
Read how Time Series Forecasting Using Foundation Models explains mean absolute error →
Machine Learning System Design
The arithmetic mean of the absolute differences between predictions and actual values.
- How it is used
- Uses MAE as a regression loss and forecast-error measure whose fit to the system goal should be justified.
- 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.
Read how Machine Learning System Design explains mean absolute error →
Grokking Machine Learning
A regression error metric equal to the average absolute difference between observed and predicted target values.
- How it is used
- Compares regression models by measuring their average absolute prediction error.
- How deep it goes
- Defines MAE as an average of absolute distances and explains why averages support comparisons across dataset sizes.
- Examples
- Uses vertical distances from points to a fitted line and contrasts datasets containing 10 and 1 million points.
- What you can do after
- Evaluate regression predictions by interpreting average absolute distances and comparing errors across differently sized datasets.
Read how Grokking Machine Learning explains mean absolute error →
Demand Forecasting Best Practices
Mean absolute error is the arithmetic mean of the absolute differences between forecasted and corresponding actual values.
- How it is used
- Measures forecast accuracy and pairs with bias to evaluate forecast quality.
- How deep it goes
- Defines, scales, and computes MAE, then explains weighting, outlier behavior, and under-forecasting limitations.
- Examples
- Works through four monthly demand observations totaling 17 absolute-error units and demonstrates Excel computation.
- What you can do after
- Apply it via Excel to compute MAE and MAE% from forecast and demand values.
Read how Demand Forecasting Best Practices explains mean absolute error →
Starting Data Analytics with Generative AI and Python
Mean absolute error is the average of the absolute differences between predicted and actual values.
- How it is used
- Evaluates regression predictions by expressing their average absolute error for practical forecasting decisions.
- How deep it goes
- Defines average absolute prediction error and compares model results, but stops short of deriving the metric mathematically.
- Examples
- Compares product-weight and product-volume models predicting freight value, reporting MAE values of 6.89 and 7.41.
- What you can do after
- Apply it via scikit-learn to compare the average prediction errors of regression models.
Read how Starting Data Analytics with Generative AI and Python explains mean absolute error →
Deep Learning with Python, Third Edition
The average absolute difference between predictions and numeric targets, used as a regression error metric.
- How it is used
- Uses MAE to monitor regression predictions, compare validation approaches, and judge forecasting baselines.
- 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 you can do after
- Evaluate regression and forecasting models with MAE, interpret scores in target units, and identify validation improvement or overfitting.
Read how Deep Learning with Python, Third Edition explains mean absolute error →
Build a Text-to-Image Generator (from Scratch)
Mean absolute error, also called L1 loss, measures the average absolute difference between predicted numerical values and their target values.
- How it is used
- Trains denoising U-Nets by scoring predicted noise against injected ground-truth noise.
- How deep it goes
- Explains the training role and PyTorch implementation, but does not derive the metric mathematically.
- Examples
- Uses noisy clothing-item and flower images, predicted noise tensors, and epoch-by-epoch generated-image checks.
- What you can do after
- Apply it via PyTorch to optimize a denoising U-Net during diffusion-model training.
Read how Build a Text-to-Image Generator (from Scratch) explains mean absolute error →
Deep Learning with R, Third Edition
Mean absolute error is the average absolute difference between predicted values and their target values.
- How it is used
- Evaluates scalar regression predictions during training and compares learned forecasts against commonsense baselines.
- How deep it goes
- Defines absolute prediction error, interprets scaled values, and demonstrates dataset-level accumulation without deriving the metric formally.
- Examples
- Uses scalar regression with scaled targets and a temperature forecast that repeats the latest observed value.
- What you can do after
- Evaluate regression models and forecasting heuristics by computing interpretable average absolute prediction errors.
Read how Deep Learning with R, Third Edition explains mean absolute error →
Related concepts
- reconstruction lossmeasures · Reconstruction loss is a measure of the discrepancy between an input or observation and the output a model reconstructs from it or its representation.
- linear regressionused by · Linear regression is a statistical modeling method that estimates a continuous response as a linear combination of predictor variables and fitted coefficients.
- objective functionkind of · An objective function assigns values to candidate solutions, predictions, or parameter settings according to a criterion to be minimized or maximized.
- baselinemeasures · A baseline is a reference value, model, condition, or performance level used to evaluate or compare measurements, outcomes, or methods.
- absolute errorproduced by · Absolute error is an error measure based on the nonnegative absolute difference between an observed value and its prediction, optionally aggregated across observations.
- language modelmeasures · A language model is a computational model that represents patterns in linguistic tokens to estimate sequence probabilities and predict or generate language from context.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.









