Mean Absolute Percentage Error (MAPE)

Machine Learning
Introduced by
J. Scott Armstrong
Year
1985
Type
Percentage-based evaluation metric
Family
Relative error metric

What does it do?

Mean Absolute Percentage Error (MAPE) measures forecast or prediction accuracy as the average of the absolute errors, each expressed as a percentage of the actual value.

Because the errors are relative, the result does not depend on the units of the data and can be compared across series. The metric is undefined whenever an actual value is zero. It is used mainly in forecasting, supply chain and business analytics.

The intuition behind the method

MAPE expresses each error as a percentage of the actual value, then averages these percentages. An actual value of 100 with prediction 110 yields 10% error, while an actual value of 10 with prediction 11 also yields 10% error. This is useful for comparing accuracy across different scales: a prediction that is off by 5 units might be 5% error on a large quantity but 50% error on a small quantity. A MAPE of 5 therefore means that, on average, predictions deviate from the actual values by 5% of those values. Because every observation gets equal weight in the average, a few observations with small actual values can still raise the figure considerably.

History

MAPE is one of the standard forecast accuracy measures in applied econometrics: econometrics textbooks present it alongside root mean squared error when evaluating forecasts (Using Econometrics: A Practical Guide, p. 446). Hyndman and Koehler (2006) took another look at measures of forecast accuracy. Kim and Kim (2016) proposed the mean arctangent absolute percentage error as an alternative for cases where actual values are zero or close to zero.

When to use it

Choose MAPE when the quantity being forecast is strictly positive, its values are well away from zero, and a relative error is what the decision needs, for example when comparing forecasts of series measured in different units or when stakeholders think in percentage terms. Because the denominator is the actual value, MAPE is a poor choice for series with zeros, intermittent demand or values near zero; Kim and Kim (2016) describe this failure directly. Do not use it for series that take both positive and negative values, where a relative error has no stable meaning. If the goal is a loss that penalizes large absolute misses, an absolute or squared-error measure is more appropriate. In practice, report MAPE alongside a simple naive forecast on the same series and alongside other accuracy measures on a common sample, as econometric forecast comparisons do (Theoretical and Empirical Exercises in Econometrics, pp. 255-256), and check how many actual values are near zero before interpreting the figure.

Limitations and considerations

  • Undefined at zero actual values, because every term divides by the actual value; Kim and Kim (2016) note that it also gives infinite or undefined results for close-to-zero actuals.
  • Asymmetric: for a non-negative forecast, an under-prediction has a bounded relative error while an over-prediction has no upper limit, so minimizing MAPE tends to favour forecasts that sit below the actual values.
  • Unstable when actual values take both signs: as an actual value approaches zero from either side, its term grows without bound, so the average can be dominated by a few observations.
  • Small actuals dominate: a single observation with a small actual value can contribute more to the average than all the others, because each term is scaled by the reciprocal of its actual value.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Unit-free: each error is divided by its actual value, so series measured in different units can be compared on one scale.
  • Relative: the same absolute miss counts for less when the actual value is large and for more when it is small, which matches how many business users judge accuracy.
  • Easy to communicate: one percentage summarizes the typical relative deviation of forecasts from actual values.
  • Familiar in applied forecasting, so results are easier to set against earlier reports that used the same measure.

Applications

  • Demand forecasting: reporting the average percentage deviation of retail sales forecasts from actual sales, for items whose sales are not zero.
  • Revenue forecasting: communicating forecast deviation to finance teams in percentage terms, where revenues are positive.
  • Traffic flow prediction: comparing estimated vehicle counts with observed counts as a percentage on corridors that carry traffic.
  • Energy consumption forecasting: assessing electricity load predictions relative to metered consumption in periods with non-zero load.
  • Inventory planning: summarizing forecast deviation as a percentage when comparing forecasting methods for stocked items with regular sales.

How it works

How it works

1

For each observation, take the absolute difference between the actual and predicted values, divide it by the actual value, and multiply by 100. The division is by the actual value alone, so the term is undefined when that value is zero.

Formula
e_i = \left| \frac{y_i - \hat{y}_i}{y_i} \right| \times 100
2

Add the percentage errors for all n observations and divide by n to obtain their arithmetic mean. The result is a typical relative deviation, not a rate of correct predictions, so a MAPE of 5 means an average deviation of 5% of the actual values.

Formula
MAPE = \frac{1}{n} \sum_{i=1}^{n} \left| \frac{y_i - \hat{y}_i}{y_i} \right| \times 100

Common pitfalls

  • Using MAPE on data that contains zeros. The formula has no value for those observations, and the sources report that results become infinite or undefined near zero. Check the actual series before computing the metric, count how many actual values are close to zero, and state any exclusions explicitly.
  • Reading MAPE as an absolute error. An average percentage says nothing about the size of misses in original units, so a modest MAPE can coexist with large misses on large-valued series, and a high MAPE can come from a few small actual values.
  • Comparing MAPE across datasets with different distributions of near-zero values without adjustment. Two series with similar typical relative accuracy can produce very different MAPE values if one contains a few near-zero actuals, so the comparison may reflect the data rather than the models.
  • Reporting MAPE without a baseline. Because there is no universal threshold for an acceptable value, a figure of 10% can be good for one series and poor for another. Compare the MAPE with that of a simple naive forecast on the same series and with the other models evaluated over the same sample.

Frequently asked questions

What do I do if my data contains zeros?

MAPE is undefined when an actual value is zero, and Kim and Kim (2016) report that it also behaves poorly for close-to-zero actuals. Options include related measures such as symmetric MAPE, mean absolute scaled error (MASE), or the mean arctangent absolute percentage error proposed by Kim and Kim (2016). Excluding zero observations is also possible, but the metric then describes a different subset, and this should be stated when results are reported. Excluding exact zeros does not remove the problem when actuals are close to zero, because those terms still dominate the average; check the distribution of actual values before choosing this option.

Why is MAPE asymmetric?

The error is divided by the actual value, not by the forecast or by an average of the two. The same pair of values therefore gives different errors depending on which one is actual: an actual of 100 with a forecast of 50 gives 50% error, while an actual of 50 with a forecast of 100 gives 100% error. For a fixed actual value, an over-prediction has no upper limit, whereas an under-prediction is bounded because a non-negative forecast cannot fall below zero.

How does MAPE compare to RMSE?

RMSE is expressed in the units of the data, so it cannot be compared directly across series with different units, whereas MAPE is unit-free. The two can also rank models differently: RMSE gives large absolute misses more weight, while MAPE gives relatively more weight to misses on small actual values. Neither is universally better, and reporting both gives a fuller picture.

When should I use symmetric MAPE instead?

Symmetric MAPE replaces the actual value in the denominator with the average of the actual and forecast values, which is intended to reduce the directional imbalance described above. Consider it when over- and under-predictions should be treated more evenly. It is a separate metric with its own properties, so check the related symmetric MAPE entry before adopting it.

Is a MAPE of 10% good?

There is no universal threshold. A MAPE value should be judged against the domain, the volatility of the series and the accuracy of a simple baseline forecast on the same data. A value that is acceptable for one series can be poor for another, and the comparison with a baseline is usually more informative than the absolute figure.

Related methods

Sources

  1. Armstrong, J. S. (1985). Long-range forecasting: from crystal ball to computer (2nd ed.). New York: John Wiley & Sons.

    ISBN: 978-0471082010
  2. Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679-688.

    Open DOI reference
  3. Kim, S., & Kim, H. (2016). A new metric of absolute percentage error for intermittent demand forecasts. International Journal of Forecasting, 32(3), 669-679.

    Open DOI reference
  4. Using Econometrics: A Practical Guide (7th Edition), p. 446

  5. Theoretical and Empirical Exercises in Econometrics, pp. 255-256