You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I raise following exception with cross validation and MSTL Model (MSTL(season_length = [12],alias='MSTL'))
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\statsforecast\models.py:5273, in MSTL.forward(self, y, h, X, X_future, level, fitted)
5269 res = self.trend_forecaster._add_conformal_intervals(
5270 fcst=res, y=x_sa, X=X, level=level
5271 )
5272 # reseasonalize results
-> 5273 seas_h = _predict_mstl_seas(model_, h=h, season_length=self.season_length)
5274 seas_insample = model_.filter(regex="seasonal*").sum(axis=1).values
5275 res = {
5276 key: val + (seas_insample if "fitted" in key else seas_h)
5277 for key, val in res.items()
5278 }
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\statsforecast\models.py:4999, in _predict_mstl_seas(mstl_ob, h, season_length)
4998 def _predict_mstl_seas(mstl_ob, h, season_length):
-> 4999 seascomp = _predict_mstl_components(mstl_ob, h, season_length)
5000 return seascomp.sum(axis=1)
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\statsforecast\models.py:4992, in _predict_mstl_components(mstl_ob, h, season_length)
4990 mp = seasonal_periods[i]
4991 colname = seasoncolumns[i]
-> 4992 seascomp[:, i] = np.tile(
4993 mstl_ob[colname].values[-mp:], trunc(1 + (h - 1) / mp)
4994 )[:h]
4995 return seascomp
ValueError: could not broadcast input array from shape (10,) into shape (12,)
TIME SERIE LENGTH = 25Months
TEST SIZE CV = window_size_for_cv + step_size_for_cv * (nb_windows_for_cv - 1) = 14
What let me think that there is an issue is if you reduce the number of month of data to 15 then it works. If it doesn't work for 25Months I don't understand why it could work with less data with the same CV configuration
What happened + What you expected to happen
I raise following exception with cross validation and MSTL Model (MSTL(season_length = [12],alias='MSTL'))
ValueError: could not broadcast input array from shape (10,) into shape (12,)
TIME SERIE LENGTH = 25Months
TEST SIZE CV = window_size_for_cv + step_size_for_cv * (nb_windows_for_cv - 1) = 14
What let me think that there is an issue is if you reduce the number of month of data to 15 then it works. If it doesn't work for 25Months I don't understand why it could work with less data with the same CV configuration
Versions / Dependencies
StatsForecast 2.0.0
Reproducible example
Issue Severity
Medium: It is a significant difficulty but I can work around it.
The text was updated successfully, but these errors were encountered: