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 fix - correct for multiple lengths of series in input sequence when adding static covariates to regression models #1469

Conversation

eliane-maalouf
Copy link
Contributor

Fixes #1460

Summary

In the original version for the code adding static covariates to regression models, it was assumed that the series are of same length.
This PR corrects this assumption and allows to support cases where the series in the input sequence have different sizes.

Other Information

None

…-when-training-global-models-on-lists-of-timeseries' into 1460-bug-static-covariates-error-when-training-global-models-on-lists-of-timeseries
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2023

Codecov Report

Base: 93.95% // Head: 93.91% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (f9a9f27) compared to base (ed83ff8).
Patch coverage: 93.54% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1469      +/-   ##
==========================================
- Coverage   93.95%   93.91%   -0.04%     
==========================================
  Files         122      122              
  Lines       10728    10728              
==========================================
- Hits        10079    10075       -4     
- Misses        649      653       +4     
Impacted Files Coverage Δ
darts/utils/data/tabularization.py 97.67% <93.33%> (-2.33%) ⬇️
darts/models/forecasting/regression_model.py 97.32% <100.00%> (ø)
darts/timeseries.py 91.78% <0.00%> (-0.23%) ⬇️
darts/ad/anomaly_model/filtering_am.py 91.93% <0.00%> (-0.13%) ⬇️
...arts/models/forecasting/torch_forecasting_model.py 89.52% <0.00%> (-0.05%) ⬇️
darts/models/forecasting/block_rnn_model.py 98.24% <0.00%> (-0.04%) ⬇️
darts/models/forecasting/nhits.py 99.27% <0.00%> (-0.01%) ⬇️
darts/datasets/__init__.py 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eliane-maalouf eliane-maalouf changed the title Bug fix - correct for multiple lengths of series in input sequence Bug fix - correct for multiple lengths of series in input sequence when adding static covariates to regression models Jan 6, 2023
Copy link
Contributor

@hrzn hrzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just had a small comment about a variable name, and possibly adding one more test. Thanks for coming up with a (non-trivial) fix quickly @eliane-maalouf !

darts/utils/data/tabularization.py Outdated Show resolved Hide resolved
@eliane-maalouf
Copy link
Contributor Author

I made a modification to the function to control for the order of the static covariates, in case they change among the series in the input. I thought it would be easier to implement the control in code instead of asking the user to make sure a certain order is present in the static covariates.

@hrzn
Copy link
Contributor

hrzn commented Jan 9, 2023

I made a modification to the function to control for the order of the static covariates, in case they change among the series in the input. I thought it would be easier to implement the control in code instead of asking the user to make sure a certain order is present in the static covariates.

👍

Copy link
Contributor

@hrzn hrzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @eliane-maalouf

@hrzn hrzn added this to In review in darts via automation Jan 10, 2023
@hrzn hrzn moved this from In review to Done in darts Jan 10, 2023
@hrzn hrzn added the bug Something isn't working label Jan 10, 2023
@hrzn hrzn merged commit f0035e3 into master Jan 10, 2023
@madtoinou madtoinou deleted the 1460-bug-static-covariates-error-when-training-global-models-on-lists-of-timeseries branch July 5, 2023 21:53
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
darts
Done
Development

Successfully merging this pull request may close these issues.

[BUG] Static covariates error when training global models on lists of TimeSeries
3 participants