The Mean Absolute Percentage Error (MAPE) is a statistical metric used to evaluate the accuracy of forecasting or prediction models. It measures the average percentage difference between predicted values and actual observed values. MAPE is expressed as a percentage, making it easy to interpret, especially in contexts where understanding relative error is more useful than absolute error. For example, in sales forecasting, a MAPE of 5% means the average prediction error is 5% of the actual values. This makes it particularly useful for comparing model performance across datasets with different scales, such as predicting monthly sales for products with varying revenue ranges.
To calculate MAPE, follow these steps:
The formula is: [ \text{MAPE} = \frac{1}{n} \sum_{t=1}^{n} \left( \frac{|A_t - P_t|}{|A_t|} \right) \times 100 ] For example, if actual sales for three days are [100, 200, 150] and predictions are [95, 210, 145], the individual percentage errors are (\frac{5}{100} \times 100 = 5%), (\frac{10}{200} \times 100 = 5%), and (\frac{5}{150} \times 100 \approx 3.33%). The MAPE is ((5 + 5 + 3.33)/3 \approx 4.44%).
MAPE has advantages and limitations. Its main strength is interpretability—expressing error as a percentage simplifies communication with stakeholders. However, it cannot handle zero actual values (division by zero) and penalizes overpredictions and underpredictions asymmetrically. For instance, if actual is 10 and predicted is 15, the error is 50%, but if actual is 15 and predicted is 10, the error is 33.3%. This asymmetry can skew results in imbalanced datasets. Developers should avoid MAPE when actual values include zeros or near-zero values. Alternatives like Mean Absolute Error (MAE) or Root Mean Squared Error (RMSE) are better suited for such cases. Despite its flaws, MAPE remains popular in domains like supply chain forecasting, where percentage-based insights align with business goals.
Zilliz Cloud is a managed vector database built on Milvus perfect for building GenAI applications.
Try FreeLike the article? Spread the word