Updating the documentation of MAPE
Correcting the formula in documentation of MAPE and also adding a note about using epsilon in denominator.
@@ -372,7 +372,9 @@ class MeanAbsoluteError(LossFunctionWrapper):
class MeanAbsolutePercentageError(LossFunctionWrapper):
"""Computes the mean absolute percentage error between `y_true` and `y_pred`.
- `loss = 100 * abs(y_true - y_pred) / y_true`
+ `loss = 100 * abs((y_true - y_pred) / y_true)`
+
+ Note that to avoid division by zero error, a small value epsilon is added to the denominator.
Standalone usage:
