diff --git a/src/gluonts/evaluation/_base.py b/src/gluonts/evaluation/_base.py index 574f900e3d..cdf442b78c 100644 --- a/src/gluonts/evaluation/_base.py +++ b/src/gluonts/evaluation/_base.py @@ -319,14 +319,19 @@ def get_metrics_per_ts( "MAPE": self.mape(pred_target, median_fcst), "sMAPE": self.smape(pred_target, median_fcst), "OWA": np.nan, # by default not calculated - "MSIS": self.msis( + } + + try: + metrics["MSIS"] = self.msis( pred_target, forecast.quantile(self.alpha / 2), forecast.quantile(1.0 - self.alpha / 2), seasonal_error, self.alpha, - ), - } + ) + except Exception: + logging.warning("Could not calculate MSIS metric.") + metrics["MSIS"] = np.nan if self.calculate_owa: metrics["OWA"] = self.owa(