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] Static covariates error when training global models on lists of TimeSeries #1460

Closed
rgrosskopf opened this issue Jan 2, 2023 · 2 comments · Fixed by #1469
Closed
Assignees
Labels
bug Something isn't working

Comments

@rgrosskopf
Copy link

Describe the bug
A ValueError is thrown when attempting to train global models (I've tried LightGBMModel and LinearRegressionModel) on lists of TimeSeries objects that all have the same static covariates assigned.

The static covariate labels are strings and I've tried both with and without using StaticCovariatesTransformer() to convert the strings to float labels.

To Reproduce
All TimeSeries objects have the same structure but vary in length. For example:
image

AND

image

Fit the model:

model = LightGBMModel(lags=[-1] , output_chunk_length=1)
model.fit(all_train_scaled, future_covariates=None)

Error:

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/darts/utils/data/tabularization.py in _add_static_covariates(model, series, features)
    219 
    220         # concatenate static covariates to features
--> 221         return np.concatenate([features, static_covs], axis=1)

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/numpy/core/overrides.py in concatenate(*args, **kwargs)

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 16571 and the array at index 1 has size 16570

Expected behavior
The static_covs array should match the dimensions of the features array so that they can be concatenated.

System (please complete the following information):

  • Python version: 3.9.5
  • darts version 0.23.0
  • lightgbm version 3.3.2

Additional context
DARTS has been a huge boost for me. Thanks for all the effort, especially the effort put into the docs.

@rgrosskopf rgrosskopf added bug Something isn't working triage Issue waiting for triaging labels Jan 2, 2023
@eliane-maalouf eliane-maalouf self-assigned this Jan 4, 2023
@eliane-maalouf
Copy link
Contributor

thank you for bringing this up @rgrosskopf, I will have a look into the issue and keep you updated

@rgrosskopf
Copy link
Author

Thanks so much for the quick turn around on the bug fix @eliane-maalouf. Handling that error was more complicated than I thought it would be.

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
None yet
3 participants