3

Assume I have 100 time series with different start and end dates but the same frequency hence they mostly have different lengths.Each time series is stored as a form of dataframe. They all look like the following:

date           item_id          target
2020-01-10        'A'              5
2020-01-11        'A'              6
2020-01-12        'A'              7
2020-01-13        'A'              8
2020-01-14        'A'              9

The second time series is:

date           item_id          target
2019-01-10        'B'              1
2019-01-11        'B'              2
2019-01-12        'B'              3
2019-01-13        'B'              4

I concatenate the time series to a big data frame and use the from_long method to create a long data frame.

dataset = PandasDataset.from_long_dataframe(long_df, time_col='date', target_col='target', item_col='item_id')

However, this gives me the following error while training:

AssertionError: Dataframe index is not uniformly spaced. If your data frame contains data from multiple series in the same column ("long" format), consider constructing the dataset with PandasDataset.from_long_dataframe instead

Can someone explain if DeepAR handles time series with different lengths (start/end date)? If No, how can I make it work when I have such a situation, and if yes, can someone explain how to to solve the above error?

user59419
  • 893
  • 8
  • 20
  • Did you ever solve this problem? I have exactly the same problem right now. I am thinking I am going to have to interpolate or something. – serlingpa Jun 27 '23 at 16:21
  • Yes, I solved it, my index was actually not uniform. – user59419 Jun 27 '23 at 21:29
  • Yes, It can be done. Start date should be different when preparing the data. Checkout https://docs.aws.amazon.com/sagemaker/latest/dg/deepar.html#deepar-inputoutput – Mukesh Kumar Sah Jul 05 '23 at 14:47

0 Answers0