awslabs / gluonts

Probabilistic time series modeling in Python
https://ts.gluon.ai
Apache License 2.0
4.41k stars 740 forks source link

Shape error when using feat_static_cat #3200

Open DushyantSahoo opened 1 week ago

DushyantSahoo commented 1 week ago

Hello, I am using deepar for forecasting. My dataset has some static categorical features (10) and input-list shape for "feat_static_cat" is (n,10). I have defined the dataset in the following way-

training_ds = ListDataset( [{"start": vector (n,1), "target": vector (n,1), "feat_dynamic_real" : matrix (n,p),
     "feat_static_cat" :(n,10),  freq = "M", one_dim_target=True )

I am getting error- GluonTSDataError: Array 'feat_static_cat' has bad shape - expected 1 dimensions, got 2.

DeepAR can take multiple categories but I am not sure how. This error is exactly same as https://github.com/awslabs/gluonts/issues/871. What is the best way to pass static category in the dataset? I am using gluonts version 0.14.4.