Mean Absolute Percentage Error (MAPE)
When you predict a number—tomorrow’s demand, a house price, next month’s revenue—you usually care not just about being “off,” but about being off by how much relative to the true value. A $10 error is tiny on a $10,000 sale and huge on a $20 sale.
What MAPE measures
Mean Absolute Percentage Error (MAPE) summarizes prediction error as an average percentage. For each example, it takes the absolute error and divides by the true value, then averages across all examples (and multiplies by 100 for “percent”):
MAPE = (100/n) * Σ |(y_true - y_pred) / y_true|
Because it’s a percentage, MAPE is scale-invariant: it lets you compare performance across products, regions, or time series with very different magnitudes. It’s also easy to explain to stakeholders: “On average, we’re off by 8%.”
Where it’s used (and why it’s appealing)
- Demand forecasting: predicting daily units sold across many SKUs with different volumes.
- Revenue forecasting: communicating error in business-friendly terms.
- Energy load prediction: comparing models across seasons with different baseline usage.
In Python, you’ll see it in scikit-learn as sklearn.metrics.mean_absolute_percentage_error (which returns a fraction; multiply by 100 for percent).
Gotchas that matter in practice
- If any y_true = 0, MAPE is undefined (division by zero). Near-zero targets can also explode the metric.
- MAPE can overweight errors on small true values, pushing models to focus on low-volume cases.
- It’s asymmetric in a subtle way because the denominator is the true value; alternatives like sMAPE or MAE can be more stable depending on the data.
Mean Absolute Percentage Error (MAPE) is a regression metric that measures average prediction error as a percentage of the true value: mean(|y − ŷ| / |y|) × 100. It is scale-free and easy to interpret across targets (e.g., “8% average error”). MAPE matters because it enables comparing forecast accuracy across different units and magnitudes, but it breaks down when true values are zero or near zero, where the percentage error becomes undefined or unstable.
Imagine you’re guessing the cost of people’s grocery baskets. If one basket costs $100 and you guessed $90, you’re off by 10%. If another costs $10 and you guessed $0, you’re off by 100%. Mean Absolute Percentage Error (MAPE) is a way to score a prediction system by averaging these “how many percent off” mistakes across many cases.
It’s popular because it’s easy to understand: lower MAPE means predictions are closer to the real values in percentage terms. It’s especially handy when you want errors to feel comparable across small and large numbers.