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
Fitting a standalone ARIMA model with covariates works but when the ARIMA model is part of a NaiveEnsemble is does not work.
To Reproduce
>>> from darts.utils.timeseries_generation import gaussian_timeseries
>>> from darts.utils.timeseries_generation import sine_timeseries
>>> FORECAST_LENGTH = 30
>>> # toy timeseries
>>> ts = gaussian_timeseries(mean=100, std=15, start=pd.Timestamp('2021-01-01'), length=365)
>>> # toy covariate
>>> covariates = sine_timeseries(start=ts.start_time(), length=365+FORECAST_LENGTH, value_y_offset=100, value_frequency=0.1)
>>> # fit standalone ARIMA model
>>> arima_model = ARIMA(p=1, q=1, d=1, random_state=1255)
>>> arima_model.supports_future_covariates
True
>>> arima_model.fit(ts, future_covariates=covariates)
>>> arima_preds = arima_model.predict(FORECAST_LENGTH, future_covariates=covariates)
>>> # fit ARIMA model as part of a NaiveEnsemble
>>> models = [
ARIMA(p=1, q=1, d=1, random_state=1255),
NaiveDrift(),
]
>>> ensemble_model = NaiveEnsembleModel(models=models)
>>> ensemble_model.supports_future_covariates
True
>>> ensemble_model.fit(ts, future_covariates=covariates)
>>> ensemble_model_preds = ensemble_model.predict(FORECAST_LENGTH, future_covariates=covariates)
ERROR:main_logger:ValueError: The model has been trained without `future_covariates` variable, but the `future_covariates` parameter provided to `predict()` is not None.
Expected behavior ensemble_model.predict(30, future_covariates=covariates) should return the average values for the separately fit NaiveDrift and ARIMA models. Instead it throws an error, claiming that the ensemble_model was fit without future_covariates (when it actually was).
System:
Python version: 3.11
darts version: 0.24.0
Additional context
Currently working around this by creating a NaiveEnsemble of models that don't use future_covariates and separate, individual models for those that do use future_covariates. I then reconstitute the average of all models with a few extra lines of code. Would be great to know whether this can be fixed (or if this isn't possible and I've misunderstood the NaiveEnsemble's capability 🤣).
The text was updated successfully, but these errors were encountered:
Describe the bug
Fitting a standalone ARIMA model with covariates works but when the ARIMA model is part of a NaiveEnsemble is does not work.
To Reproduce
Expected behavior
ensemble_model.predict(30, future_covariates=covariates)
should return the average values for the separately fitNaiveDrift
andARIMA
models. Instead it throws an error, claiming that theensemble_model
was fit withoutfuture_covariates
(when it actually was).System:
Additional context
Currently working around this by creating a
NaiveEnsemble
of models that don't usefuture_covariates
and separate, individual models for those that do usefuture_covariates
. I then reconstitute the average of all models with a few extra lines of code. Would be great to know whether this can be fixed (or if this isn't possible and I've misunderstood theNaiveEnsemble
's capability 🤣).The text was updated successfully, but these errors were encountered: