I tried adding future datafame using
future = m.make_future_dataframe(df, periods= 720, n_historic_predictions=True)
However, only 1 row is added to the dataframe, instead of 720 rows.
Model code :
m = NeuralProphet(
changepoints_range=0.95,
normalize='soft',
n_changepoints=50,
trend_reg=1,
yearly_seasonality=False,
weekly_seasonality=True,
daily_seasonality=10,
n_lags = 7 # If i remove this line the future dataframe works just fine
)
m.add_seasonality(name="monthly", period=30.5, fourier_order=5)
m.set_plotting_backend("plotly")
metrics = m.fit(df, freq="H")
The documentation didnt mention anything that AR would affect make_future_dataframe feature https://neuralprophet.com/code/forecaster.html
Extends dataframe a number of periods (time steps) into the future.Only use if you predict into the unknown future. New timestamps are added to the historic dataframe, with the ‘y’ column being NaN, as it remains to be predicted. Further, the given future events and regressors are added to the periods new timestamps. The returned dataframe will include historic data needed to additionally produce n_historic_predictions, for which there are historic observances of the series ‘y’.
Came to this problem before. What i needed to realize is that by default, auto regression only predicts one next step. This is actually mentioned in documentations, but is easy to overlook. This is reason why only one row is added.
If you want to predict more than one next step, use n_forecasts parameter in neural prophet constructor call
since you need 720 days prediction for each consecutive prediction model needs also last predictions. So to create 720 predictions into future, you need to run "next step" prediction 720 times, always adding last guess into list of lags.
One more important thing that happened to me and cost me few days of headache, i used validation dataframe for predicting future same as shown in documentation, and got success result that i was not able to reproduce since. Problem was, that if you provide 720 lines dataframe, containing real 'y' values, NP does 720 individual prediction in silence using last n lags of real 'y' each time. This creates illusion that model can predict 720 days into future at once....which it can not, because in reality you need new predictions to create even newer predictions.