0

I am using the timeseries forecast algorithm ´prophet` from sktime. I have the following train and test set:

X1_train
             Saldo
timepoint          
2017-01-01 -3574.22
2017-02-01  6351.78
2017-03-01  3297.65
2017-04-01  1016.30
...

X1_test
           Saldo
timepoint          
2017-01-01 -3574.22
...
2018-11-01  1254.95
2018-12-01  1990.26
2019-01-01  1658.30
2019-02-01   975.19

where both are a <class 'pandas.core.frame.DataFrame'> and Saldo: float64and timepoint is a datetime.index:

print(X1_test.index)
         '2018-05-01', '2018-06-01', '2018-07-01', '2018-08-01',
               '2018-09-01', '2018-10-01', '2018-11-01', '2018-12-01',
               '2019-01-01', '2019-02-01'],
              dtype='datetime64[ns]', name='timepoint', freq=None)

I am to train the model:

ph = Prophet()
ph.fit(X1_train)

when I try to run the forecast:

forecast = ph.predict(fh= [pd.date_range(X1_test.index[0], X1_test.index.max())])

I get the error:

the type of the passed fh values is not supported..please use one of ('int', '1D np.ndarray of type int', '1D np.ndarray of type timedelta or dateoffset', 'list', 'pd.RangeIndex', 'pd.PeriodIndex', 'pd.DatetimeIndex', 'pd.TimedeltaIndex'), but found type <class 'list'>

However:

print(X1_test.index[0])
2017-01-01 00:00:00

What I am doing wrong here?

PV8
  • 5,799
  • 7
  • 43
  • 87

0 Answers0