Mean absolute error
Mean absolute error is the arithmetic mean of the absolute differences between corresponding predicted and observed 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.
Build AI Drug Discovery Pipelines
Mean absolute error is the average of the absolute differences between observed target values and model predictions.
- How it is used
- Evaluates prediction error on a held-out test set for a kinase activity model.
- How deep it goes
- Defines MAE as an aggregate of absolute residuals and reports a test result; defers evaluation-function implementation details.
- Examples
- Reports a kinase model’s test MAE of 0.7274 alongside its mean squared error.
- What you can do after
- Evaluate/understand model error using MAE alongside other metrics and the target-value range.
Read how Build AI Drug Discovery Pipelines explains mean absolute error →
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 pixel-level reconstruction error and trains models to predict added image noise.
- How deep it goes
- Explains elementwise averaging and the contrast with squared error, then applies the loss in a training loop.
- Examples
- Uses handwritten-digit reconstruction and flower-image noise prediction as concrete tasks.
- What you can do after
- Apply it via PyTorch to compare predicted and actual noise during denoising U-Net training.
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 forecasting metric whose selection should reflect system goals.
- How deep it goes
- Explains median optimization, contrasts squared and percentage errors, and defines two MAE-based scaled measures.
- Examples
- Uses cryptocurrency exchange-volume prediction and low-volume retail demand forecasting to motivate metric choices.
- What you can do after
- Evaluate whether MAE fits a forecasting goal, especially when demand distributions are asymmetric.
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 →
Vibe Engineering
Mean absolute error is a regression metric equal to the average absolute difference between predicted and actual values.
- How it is used
- Evaluates test-set price predictions in currency units, alongside complementary regression metrics.
- How deep it goes
- Defines absolute-error averaging and interprets its limits, then compares baseline and revised model metrics without isolating individual improvements.
- Examples
- Compares drug-price prediction errors of 77.50 INR and 57.98 INR across two model evaluations.
- What you can do after
- Evaluate regression predictions by interpreting MAE in target units and checking complementary metrics for large errors.
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 →
Quantization and Fast Inference
The average absolute element-wise difference between two numerical outputs.
- How it is used
- Compares raw model outputs to assess typical divergence across exported and quantized variants.
- How deep it goes
- Defines the metric and implements it as the mean of absolute element-wise differences, without deriving further statistical properties.
- Examples
- Reports ResNet-18 mean absolute differences of 0.021 for TorchAO INT8 weight-only and 0.135 for ORT Static INT8.
- What you can do after
- Evaluate typical logit divergence between a PyTorch FP32 baseline and exported or quantized variants.
Read how Quantization and Fast Inference explains mean absolute error →
Grokking Machine Learning, Second Edition
A regression metric equal to the average absolute difference between predicted and observed numerical values.
- How it is used
- Measures how far a regression line is from observed points on average.
- How deep it goes
- Defines averaged absolute distances and motivates dataset-size comparability, but does not detail implementation.
- Examples
- Uses house-price prediction and a house size–price dataset for calculating MAE and RMSE.
- What you can do after
- Evaluate a regression model by calculating its average absolute prediction error.
Read how Grokking Machine Learning, Second Edition 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 →
CUDA for LLMs
Mean absolute error is the average absolute difference between corresponding predicted or reconstructed and reference values.
- How it is used
- Validates quantization quality by summarizing typical absolute error.
- How deep it goes
- Defines the average and works a four-value example, but gives no implementation procedure.
- Examples
- Calculates MAE as 0.005 for errors [0.0, –0.01, 0.0, –0.01].
- What you can do after
- Evaluate typical quantization error and check model performance on separate test data.
Also covered in
- Statistics Every Programmer Needs
- Bayesian Optimization in Action
- Machines that ThinkIn early access (MEAP)
- The AI Pocket Book
- Digital Twins in Action
What to know first
- accuracyAccuracy is the degree to which a result agrees with a specified truth, reference, or criterion, commonly measured as the proportion of evaluated predictions that are correct.
- epochAn epoch is one complete pass through the training data during model training.
- linear regressionLinear regression is a statistical method that models a numeric response as a linear function of one or more predictor variables with fitted parameters.
- overfittingOverfitting is a modeling condition in which a model adapts too closely to particular data, including its noise or idiosyncrasies, and consequently generalizes poorly to new data.
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.
- objective functionkind of · An objective function is a mathematical function that assigns values to candidate solutions or parameter settings, which an optimization procedure seeks to minimize or maximize.
- baselinemeasures · A baseline is a reference model, result, measurement, or level used to compare performance or assess change.
- linear regressionused by · Linear regression is a statistical method that models a numeric response as a linear function of one or more predictor variables with fitted parameters.
- 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.
Questions about mean absolute error
What is mean absolute error?
Mean absolute error is the arithmetic mean of the absolute differences between corresponding predicted and observed numerical values.
Which Manning books explain mean absolute error?
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI, Build AI Drug Discovery Pipelines, Learn Generative AI with PyTorch, Time Series Forecasting Using Foundation Models, Machine Learning System Design, Grokking Machine Learning, Demand Forecasting Best Practices, Starting Data Analytics with Generative AI and Python and 7 more.
What should I know before learning mean absolute error?
Manning books that teach mean absolute error usually introduce accuracy, epoch, linear regression and overfitting first.
What kinds of mean absolute error are there?
Kinds of mean absolute error include cost-weighted mean absolute error.
What is mean absolute error a kind of?
Mean absolute error is a kind of objective function. An objective function is a mathematical function that assigns values to candidate solutions or parameter settings, which an optimization procedure seeks to minimize or maximize.
What is mean absolute error also called?
Mean absolute error is also called MAE or L1 loss.
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.














