solarforecastarbiter.metrics.deterministic.mean_absolute_percentage

solarforecastarbiter.metrics.deterministic.mean_absolute_percentage(obs, fx, error_fnc=<function error>)[source]

Mean absolute percentage error (MAPE).

\[\text{MAPE} = 1/n \sum_{i=1}^n | (\text{fx}_i - \text{obs}_i) / \text{obs}_i | * 100%\]
Parameters:
  • obs ((n,) array-like) – Observed values.
  • fx ((n,) array-like) – Forecasted values.
  • error_fnc (function) – A function that returns the error, default fx - obs. First argument is obs, second argument is fx.
Returns:

mape (float) – The MAPE [%] of the forecast.