I create a collection of time series (
concat_df), as needed by the DeepAR method:
Each row is a time series. This collection is used to train the DeepAR model. The input format expected by DeepAr is a list of series. So I create this from the above data frame:
time_series =  for index, row in concat_df.iterrows(): time_series.append(row)
With this list of time series I then set the
context_length (note I am setting frequency to Daily in this first example):
freq = "D" prediction_length = 3 context_length = 3
...as well as the
Number of Time Series and
t0 = concat_df.columns data_length = concat_df.shape num_ts = concat_df.shape period = 12
I create the training set:
time_series_training =  for ts in time_series: time_series_training.append(ts[:-prediction_length])
..and visualize this with the test set:
time_series.plot(label="test") time_series_training.plot(label="train", ls=":") plt.legend() plt.show()
So far so good, everything seems to agree with the tutorial.
I then use the remaining code to invoke the deployed model as explained in the referenced article:
list_of_df = predictor.predict(time_series_training[:5], content_type="application/json")
BUT, if I change the frequency to monthly (
freq = "M") I get the following error:
ValueError: Units 'M', 'Y', and 'y' are no longer supported, as they do not represent unambiguous timedelta values durations.
Why would monthly data not be accepted? How can I train monthly data on DeepAR? Is there a way to specify some daily equivalent to monthly data?
This appears to be some kind of Pandas error, as shown here.