Mean absolute percentage error (MAPE) is one of the most common metrics of model prediction accuracy and the percentage equivalent of mean absolute error (MAE). MAPE measures the average magnitude of error a model produces, or how far off predictions are on average, expressed as a percentage of the actual value. It answers a question business teams ask in plain language: “How wrong are we, percent-wise?”
Forecasting and operations groups reach for MAPE when targets vary in scale. An MAE of 50 units might be trivial on one product line and catastrophic on another. MAPE normalizes by the actual, so you can compare relative error across SKUs, regions, or time periods without rebuilding charts in different units.
Build better agents with Arize
Trace, evaluate, and learn. Build agents that work with Arize AX and start tracing your runs today.
Prefer open source? Try Arize Phoenix for self-hosted, open source agent observability.
Key takeaways
- MAPE averages absolute percentage residuals:
MAPE = (100/n) * sum(|(y_i - y_hat_i) / y_i|). - MAPE inherits MAE’s linear treatment of error magnitude. It does not square large misses the way MSE does.
- MAPE is undefined or unstable when actual values are zero or very small. Filter, clip, or switch metrics before you trust the number.
- MAPE is asymmetric in practice: under-forecasts and over-forecasts can look different to stakeholders even when MAPE treats them the same.
- Compare MAPE to a naive seasonal baseline and to the previous model on the same holdout split, not to a generic industry threshold.
How MAPE is calculated
For each row with actual y_i and prediction y_hat_i:
MAPE = (100 / n) * sum( |(y_i - y_hat_i) / y_i| )
Some teams report MAPE as a fraction between 0 and 1 instead of multiplying by 100. State which convention you use in dashboards and model cards.
Example: actuals [100, 200, 50] and predictions [110, 180, 55]. Absolute percentage errors are 10%, 10%, and 10%. MAPE is 10% under the percent convention.
In Python:
import numpy as np
mape = np.mean(np.abs((y_true - y_pred) / y_true)) * 100
Guard against division by zero before you call this on production data.
MAPE vs MAE and other regression metrics
MAE reports error in target units. MAPE reports error relative to each actual. They rank models similarly when targets are well behaved and far from zero, but they diverge when scale varies across rows.
MAE is the safer default when zeros appear in the data or when actuals span orders of magnitude with many small values. MAE never divides by the target.
RMSE penalizes large misses more heavily. A model can look good on MAPE while RMSE punishes a few catastrophic forecasts. Report both when big misses have real cost.
Symmetric MAPE (sMAPE) variants exist to reduce bias toward low forecasts. Teams adopt them when executives track error symmetrically. Stick to one definition per program so release comparisons stay valid.
The original stub pointed to MAE for shared considerations: linear weighting of errors, sensitivity to outliers in the numerator, and the need to read the metric against a baseline rather than in isolation. Those apply here with the added wrinkle of the denominator.
When MAPE is useful
MAPE fits demand planning, energy load forecasting, and finance projections where stakeholders think in percent error:
- Cross-SKU comparison when unit counts differ but percent accuracy is the contract.
- Executive reporting where “we were off by 4% last quarter” lands better than an abstract unit error.
- Monitoring relative drift when absolute scale grows seasonally but percent tolerance stays fixed.
Track MAPE on a fixed labeled holdout and on recent production windows with delayed labels. If percent error creeps up while MAE looks flat, your model may be fine on large-volume lines and failing on smaller ones. Slice before you retrain.
Pair the metric with model and concept drift checks. Input drift can leave aggregate MAPE stable while a cohort moves outside the tolerance band you promised operations.
Where MAPE breaks down
Zero or near-zero actuals. Division by zero is undefined. Division by 0.01 turns a tiny absolute miss into a huge percentage. Exclude those rows, add a epsilon (and document it), or use MAE on affected segments.
Intermittent demand. Retail and spare-parts series with long zero runs produce meaningless or volatile MAPE. Use MAE, quantile loss, or specialized intermittent-demand scores for those SKUs and keep MAPE for the subset with stable nonzero demand.
Asymmetric business cost. MAPE treats +10% and -10% the same. Stockouts and overstocks rarely cost the same. MAPE is a reporting metric, not a loss function, unless you validate it against real dollars.
Comparing across different MAPE definitions. Some libraries mean absolute percentage error, others mean absolute percentage deviation with different scaling. Align notebooks, batch jobs, and monitoring queries on one formula.
For NLP pipelines that mix regression heads with classifiers, percent error on numeric outputs still makes sense while text quality needs separate evaluators. Sentiment and classification monitoring often tracks both: MAPE or MAE on numeric side outputs, precision and recall on the categorical head.
MAPE in release and lifecycle reviews
Before promotion, record MAPE on the same holdout you used for the prior version. Store it with artifacts and training metadata so auditors can reproduce the comparison. When labels arrive late, refresh MAPE on rolling backtests rather than trusting only offline numbers from training time.
AI model lifecycle management treats that score as part of the release gate: percent error within tolerance on the golden set, no worsening trend on key slices, drift checks green. MAPE alone never clears a model for production, but it is often the number executives recognize first.
FAQ
What is the formula for MAPE?
MAPE = (100/n) * sum(|(y_i - y_hat_i) / y_i|) when reported as a percentage. Average absolute percent error across rows. Skip or handle rows where y_i is zero.
What is a good MAPE score?
There is no single benchmark. Compare to a seasonal naive forecast on the same split and to your last production model. A “good” percent error in grocery replenishment may be unacceptable in chip yield forecasting. Context sets the bar.
Why is MAPE undefined at zero?
The formula divides by the actual. When the actual is zero, the ratio is undefined. Near-zero actuals inflate MAPE even when absolute error is small. Filter those rows or use MAE instead.
What is the difference between MAPE and MAE?
MAE measures average absolute error in target units. MAPE measures average absolute error as a fraction of each actual. MAPE enables relative comparison across scales; MAE is safer when zeros or tiny actuals appear.
Should I optimize MAE or MAPE during training?
Optimizing MAPE directly can overweight small actuals because of the denominator. Many teams train with MAE or Huber loss and report MAPE on validation for stakeholders. If percent error is the contractual metric, validate that the training objective aligns with the penalties you care about.