NannyML / The-Little-Book-of-ML-Metrics

The book every data scientist needs on their desk.
https://www.nannyml.com/metrics
757 stars 60 forks source link

Rephrase MAPE's asymmetric explanation #103

Closed santiviquez closed 3 weeks ago

santiviquez commented 1 month ago

Metric's name MAPE

Metric category Regression

Issue with current description The current MAPE page mentions that MAPE penalizes negative errors more. This is justified by the following explanation:

_"Minimizing MAPE creates an incentive towards smaller y_hat - if our actuals have an equal chance of being y=1 or y=3, then we will minimize the expected MAPE by forecasting y_hat=1.5, not yhat=2, which is the expectation of our actuals. Thus, minimizing it may lead to forecasts that are biased low."

However, if we look at it from the perspective of model evaluation, it turns out that our MAPE is symmetric around y_hat.

_"If we fix y to be, say, 100, then mape is symmetric around y_hat right? If y_hat=90 or yhat=110, the mape is still 0.1 for both, it’s not penalizing the underestimated prediction more"

Suggestion Rephrase some of the points to make it clearer that the asymmetry occurs when we try to optimize a model by minimizing MAPE. In evaluation (when we have predictions and ground truth), MAPE is indeed symmetrical, as pointed out.

Context: https://www.reddit.com/r/datascience/comments/1g3kgyv/comment/ls23dz1/?context=3

santiviquez commented 3 weeks ago

solved in https://github.com/NannyML/The-Little-Book-of-ML-Metrics/commit/4460bed92e702a7672201d4e2e49845808025dd4