Closed timofeytkachenko closed 7 months ago
Hi @timofeytkachenko,
These two methods don't have to the same logic, which is detailed in their respective docstring:
predict()
is used to forecast n
values after the end of the provided series
. If n>output_chunk_length
, the function will rely on auto-regression (consume its own forecasts) to generate the remaining time steps.historical_forecasts()
is used to mimic how the model would have performed if it was trained "in the past" and used to forecast a series
over time. After each forecast, the ground-truth is made available to the model for the next forecast (limited auto-regression, only if forecast_horizon>output_chunk_length
). Performance is expected to be better.I hope that the difference is clearer.
Thank you in advance
I trained the model and used the historical_forecasts method to predict the validation series and after it I used method predict to do the same and had different results. with different R2 and MAPE. I dont understand the reason why it works like that.
pred_series = model_nbeats.historical_forecasts( series_scaled, start=split_date, forecast_horizon=10, stride=10, last_points_only=False, retrain=False, verbose=False, ) pred_series = concatenate(pred_series)
forecast = model_nbeats.predict(n=len(val_scaled))