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

Static Covariates example #1016

Closed
gdevos010 opened this issue Jun 18, 2022 · 6 comments
Closed

Static Covariates example #1016

gdevos010 opened this issue Jun 18, 2022 · 6 comments
Labels
triage Issue waiting for triaging

Comments

@gdevos010
Copy link
Contributor

Is your feature request related to a current problem? Please describe.
@dennisbader Could you add a static covariates example? I tried looking through the test code, but I had trouble converting it to a real-world example.

@gdevos010 gdevos010 added the triage Issue waiting for triaging label Jun 18, 2022
@martinb-ai
Copy link

Second this! 😃

@dennisbader
Copy link
Collaborator

dennisbader commented Jun 23, 2022

I am out of office this and the next two weeks.
Happy to do it when I get back :)

For the meantime, you can check out TimeSeries.from_group_dataframe() here, the satallion beer /sales dataset, and use TFTModel (currently the only one that supports static covariates).

The static covariates should be embedded in your target TimeSeries which you can simply pass to fit/predict.

After TimeSeries.from_group_dataframe() you can check the static covariates of the target series with target.static_covariates.

@irenasb
Copy link

irenasb commented Jul 16, 2022

Hi everyone,
I was playing with the functionalities for static covariates in the last days while waiting for the official example :) so I created an exemplary notebook - perhaps someone is still looking for it? I have to say I am not 100% confident that this is the way it should be done (I know it's definitely not the only way), so I would be happy if someone wants to review and perhaps confirm it makes sense.
https://github.com/irenasb/darts/blob/isb/static-example/examples/15-static-covariates.ipynb
I figured one can have as an input a list of time series, or one time series with multiple components. I included both ways in the notebook. It's not so difficult to now generalize the cases to real data. If I have time I would try the Beeristan set from kaggle soon.

@dennisbader
Copy link
Collaborator

Hey everyone, #1081 adds some more features surrounding static covariate and also a tutorial on static covariates.
You can find the notebook here. Note that running the notebook requires the new branch from #1081.

Give it a read if you have time and let me know if there is anything missing to get you going with static covariates :)

@irenasb thanks a lot sharing this. It looks like you were already on the right track! My only remark would be that you don't have to add static covariates to the past or future covariates, as only static covariates embedded in the target series are used by the models.

@gdevos010
Copy link
Contributor Author

Thanks for creating this! I will be back at my computer in a few days and I will look it over them.

@dennisbader
Copy link
Collaborator

Closing as added in #1081. You can find the notebook in the repo here and when releasing the new darts version also in our docs' examples section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issue waiting for triaging
Projects
None yet
Development

No branches or pull requests

4 participants