awslabs / gluonts

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

Shape error when using feat_static_cat #3200

Open DushyantSahoo opened 5 months ago

DushyantSahoo commented 5 months 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.