pythontime-seriesforecastingarimafacebook-prophet

Forecasting in FB Prophet by Minute


I'm attempting to do minute forecasting using Prophet. But I'm getting strange output. Any suggestions on how to forecast by minute in Prophet or suggestions for improving my code would be very appreciated!

Data is in format for FB Prophet.

df_min.head()
    ds  y
0   2020-01-17 14:21:00     166.380
1   2020-01-17 14:22:00     166.335
2   2020-01-17 14:23:00     166.315
3   2020-01-17 14:24:00     166.320
4   2020-01-17 14:25:00     166.355

There are 100 minutes within the df_min dataframe. Below, breaking out 30 minutes for the train_df_min dataframe...

prediction_size = 30
train_df_min = df_min[:-prediction_size]

Now attempting the forecast...

q = Prophet(daily_seasonality=True)
q.fit(train_df_min)

future2 = q.make_future_dataframe(periods=60, freq='1min')
forecast2 = q.predict(future2)
forecast2.tail()

enter image description here

And the chart output...

enter image description here


Solution

  • Convert your minute data into hour,weekly,monthly,etc.. then compare accuracy, take the frequency which is giving more accurate forecast.