Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RegressionModel historical forecasts with specific encoder lags #1875

Closed
dennisbader opened this issue Jul 2, 2023 · 0 comments · Fixed by #2034
Closed

[BUG] RegressionModel historical forecasts with specific encoder lags #1875

dennisbader opened this issue Jul 2, 2023 · 0 comments · Fixed by #2034
Assignees
Labels
bug Something isn't working

Comments

@dennisbader
Copy link
Collaborator

dennisbader commented Jul 2, 2023

Describe the bug
There is a bug when calling historical_forecasts on a RegressionModel that uses encoders with a non-divisible frequency RegressionModels and non-overlapping maximum lag with the target lags.

To Reproduce

from darts.models import LinearRegressionModel
from darts.datasets import AirPassengersDataset

model = LinearRegressionModel(
    lags=3,
    lags_past_covariates=[-3, -2],
    add_encoders={
        "cyclic": {"past": ["month"]},
    }
)

series = AirPassengersDataset().load()
hc = model.historical_forecasts(series=series)

Expected behavior
Should not raise an error. The error

System (please complete the following information):

  • Python version: [e.g. 3.10]
  • darts version [master]

Additional context
The error can be avoided by passing series also as past_covariates to historical forecasts. Reason is that encoders are generated on the fly with minimum time span requirements -> we have to calculate the expected start index of covariates because it is not available in the time index generated by the encoders.

@dennisbader dennisbader added bug Something isn't working triage Issue waiting for triaging and removed triage Issue waiting for triaging labels Jul 2, 2023
@dennisbader dennisbader changed the title [BUG] [BUG] RegressionModel historical forecasts with specific encoder lags Jul 2, 2023
@github-project-automation github-project-automation bot moved this to Released in darts Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Released
Development

Successfully merging a pull request may close this issue.

2 participants