gluonts.evaluation.metrics module

gluonts.evaluation.metrics.abs_error(target: numpy.ndarray, forecast: numpy.ndarray) → float[source]
gluonts.evaluation.metrics.abs_target_mean(target) → float[source]
gluonts.evaluation.metrics.abs_target_sum(target) → float[source]
gluonts.evaluation.metrics.calculate_seasonal_error(past_data: numpy.ndarray, forecast: gluonts.model.forecast.Forecast, seasonality: Optional[int] = None)[source]
\[seasonal_error = mean(|Y[t] - Y[t-m]|)\]

where m is the seasonal frequency https://www.m4.unic.ac.cy/wp-content/uploads/2018/03/M4-Competitors-Guide.pdf

gluonts.evaluation.metrics.coverage(target: numpy.ndarray, forecast: numpy.ndarray) → float[source]
gluonts.evaluation.metrics.mape(target: numpy.ndarray, forecast: numpy.ndarray) → float[source]
\[mape = mean(|Y - Y_hat| / |Y|))\]
gluonts.evaluation.metrics.mase(target: numpy.ndarray, forecast: numpy.ndarray, seasonal_error: float) → float[source]
\[mase = mean(|Y - Y_hat|) / seasonal_error\]

https://www.m4.unic.ac.cy/wp-content/uploads/2018/03/M4-Competitors-Guide.pdf

gluonts.evaluation.metrics.mse(target: numpy.ndarray, forecast: numpy.ndarray) → float[source]
gluonts.evaluation.metrics.msis(target: numpy.ndarray, lower_quantile: numpy.ndarray, upper_quantile: numpy.ndarray, seasonal_error: float, alpha: float) → float[source]
Math

msis = mean(U - L + 2/alpha * (L-Y) * I[Y<L] + 2/alpha * (Y-U) * I[Y>U]) / seasonal_error

https://www.m4.unic.ac.cy/wp-content/uploads/2018/03/M4-Competitors-Guide.pdf

gluonts.evaluation.metrics.owa(target: numpy.ndarray, forecast: numpy.ndarray, past_data: numpy.ndarray, seasonal_error: float, start_date: pandas._libs.tslibs.timestamps.Timestamp) → float[source]
\[owa = 0.5*(smape/smape_naive + mase/mase_naive)\]

https://www.m4.unic.ac.cy/wp-content/uploads/2018/03/M4-Competitors-Guide.pdf

gluonts.evaluation.metrics.quantile_loss(target: numpy.ndarray, forecast: numpy.ndarray, q: float) → float[source]
gluonts.evaluation.metrics.smape(target: numpy.ndarray, forecast: numpy.ndarray) → float[source]
\[smape = 2 * mean(|Y - Y_hat| / (|Y| + |Y_hat|))\]

https://www.m4.unic.ac.cy/wp-content/uploads/2018/03/M4-Competitors-Guide.pdf