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

Different lags for each past_covariate in past_covariates #1110

Closed
BrandonJenkins0 opened this issue Aug 1, 2022 · 5 comments · Fixed by #1962
Closed

Different lags for each past_covariate in past_covariates #1110

BrandonJenkins0 opened this issue Aug 1, 2022 · 5 comments · Fixed by #1962
Labels
core improvement Significant change, refactor or improvement

Comments

@BrandonJenkins0
Copy link

From what I understand, the lags_past_covariates argument takes a list or integer and applies the same lags to all past covariates. Is it possible to lag each past_covariate differently when using a regression model? For example, I have the following past_covariates feature1, feature2, feature3 and I want these lags for each:

{'feature1': [-2, -4] 'feature2:' [-1, -7] 'feature3': [-2, -3]}

Any recommendations on how I could accomplish this?

Really enjoying the package by the way!

@BrandonJenkins0 BrandonJenkins0 added the triage Issue waiting for triaging label Aug 1, 2022
@hrzn
Copy link
Contributor

hrzn commented Aug 2, 2022

Hi, thanks for raising. At the moment this is not possible. However, this would be a nice feature, which we already had in mind for some time. I'll put this issue in our backlog, so we have this somewhere in the development roadmap :)

@hrzn hrzn added core improvement Significant change, refactor or improvement and removed triage Issue waiting for triaging labels Aug 2, 2022
@feedFloward
Copy link

A possible workaround is to lag your features with pandas shift() method individually then turn them to timeseries object and pass to fit.
You need to pass [0] as lags_future_covariates or past_future_covariates since you already lagged them and darts should treat them as they are.

@JanFidor
Copy link
Contributor

JanFidor commented Mar 3, 2023

Hi @hrzn, what do you think about using something similar to add_encoders param? So basically a nested dictionary where the first key could only have one of 3 values: ["series", "past_covariates", "future_covariates"], and covariates could either be further indexed by their names to get unique lags or have shared ones.

@tsobolev
Copy link

tsobolev commented May 6, 2023

After reading all the documentation I had the same question. Perhaps it would be convenient to have different sets of lags for groups of covariates features.

@wojnarabc
Copy link

wojnarabc commented May 18, 2023

Would be great to have it configurable on per covariate (group) basis, eventually option to exclude some for which we do not wish to create any lags altogether. Especially that calendar features created automatically through add_encoders parameter (any RegressionModel based model types), seem to be also lagged automatically as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core improvement Significant change, refactor or improvement
Projects
Status: Released
Development

Successfully merging a pull request may close this issue.

6 participants