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
Describe the bug
NaiveEnsembleModel with a NaiveSeasonal with k>3 almost allways gives me an ValueError.
I dont' found a way to prevent this
To Reproduce
fromdartsimportTimeSeriesfromdarts.models.forecasting.baselinesimportNaiveMean, NaiveSeasonal, NaiveEnsembleModelimportnumpyasnpy=TimeSeries.from_values(np.arange(100))
# NaiveSeasonal alone works fine (no error)naive_seasonal=NaiveSeasonal(7)
naive_seasonal.fit(y[:50])
naive_seasonal.backtest(y);
# However inside an Ensemble, it gives me a ValueErrornaive_ensemble=NaiveEnsembleModel([NaiveMean(), NaiveSeasonal(7)])
naive_ensemble.fit(y[:50])
naive_ensemble.backtest(y);
# ValueError: Train series only contains 3 elements but Naive seasonal model, with K=7 model requires at least 7 entries# Even if the inputs are dividable by 7 its an ValueErrornaive_ensemble=NaiveEnsembleModel([NaiveMean(), NaiveSeasonal(7)])
naive_ensemble.fit(y[:49])
naive_ensemble.backtest(y[:98]);
# ValueError: Train series only contains 3 elements but Naive seasonal model, with K=7 model requires at least 7 entries
Expected behavior
It should work as it works alone
System (please complete the following information):
Python 3.8.10
darts 0.23.1
Additional context
As fare as i figured out, it goes down to the EnsembleModel Base Class
It is may solvable by taking into account the extreme_lags proberty of each model inside of the ensemble
However, it is strange to me, that it is also happening when the inputs are dividable by k=7. So i don't even have a workaround at the time! In fact, i didn't found any length of y [0..100] or k>3 so that it works
The text was updated successfully, but these errors were encountered:
Hi @turbotimon, great find, the error is thrown for ensemble .historical_forecasts() and by extension .backtest() if it has any model with input_chunk_length > 1 or lags looking further than -1. I think I found the cause, when calling historical_forecasts and iterating over historical_series, minimum length is set incorrectly, after digging around with a debugger I found out that the Ensemble's max target lag (in extreme_lags) is set to 1 while it should've taken into account it's models extreme lags. I'll make a quick PR @dennisbader@hrzn@madtoinou
Describe the bug
NaiveEnsembleModel with a NaiveSeasonal with k>3 almost allways gives me an ValueError.
I dont' found a way to prevent this
To Reproduce
Expected behavior
It should work as it works alone
System (please complete the following information):
Additional context
extreme_lags
proberty of each model inside of the ensembleThe text was updated successfully, but these errors were encountered: