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.92k stars 859 forks source link

The speed of the predict and historical_forecasts functions #1736

Closed linbingkong closed 1 year ago

linbingkong commented 1 year ago

The running time of the predict and historical_forecasts functions is much longer than the training time. I would like to ask if this is normal

linbingkong commented 1 year ago

fit time:1m19.7s predict time:20m+

dennisbader commented 1 year ago

Hi @linbingkong , adding a reproducible example always helps to better answer to issues. predict() vs. fit() should not be longer. historical_forecasts() (with retrain=True) vs. fit() is expected to take much longer as it goes through multiple fit/predict iterations. You can find the documentation here.

We are also working on optimizing historical_forecasts (if the parameters and model allow it) as explained in this issue.

linbingkong commented 1 year ago

@dennisbader thank you for your reply. I implemented it according to the Nbeats-examples.ipynb,I change the historical_forecasts function into 'pred_series = model_nbeats.predict(7) display_forecast(pred_series, series, "7 day", start_date=pd.Timestamp("20170901"))',the model fit spend 39.2s ,but predict spend 7m+

linbingkong commented 1 year ago

@dennisbader Sorry .It's the compiler's problem, it's very slow when I use vscode, but pycharm is normal.Thank you