unit8co / darts

A python library for user-friendly forecasting and anomaly detection on time series.
https://unit8co.github.io/darts/
Apache License 2.0
7.91k stars 857 forks source link

[BUG] The result of N-BEATS and N-HITS is not reproducible #2076

Closed timofeytkachenko closed 7 months ago

timofeytkachenko commented 10 months ago

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)

historical_forecasts

forecast = model_nbeats.predict(n=len(val_scaled))

predict
madtoinou commented 10 months ago

Hi @timofeytkachenko,

These two methods don't have to the same logic, which is detailed in their respective docstring:

I hope that the difference is clearer.

timofeytkachenko commented 10 months ago

Thank you in advance