Regression
Mean absolute percentage error
Implemented
regression.mapeDefinition
Average absolute error relative to the magnitude of the target.
Formula
MAPE = (1/N) Σᵢ |yᵢ − ŷᵢ| / |yᵢ|
Range: [0, ∞)
Inputs and outputs
- y_true: array of real targets
- y_pred: array of real predictions
- sample_weight: optional
Returns: float
Assumptions
- All targets must be non-zero; zero targets raise a validation error.
Limitations
- Asymmetric: penalises over-prediction and under-prediction differently.
Python API
import evalsuite as es
es.mape(y_true_r, y_pred_r)References
- Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679–688.