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.55k stars 829 forks source link

Enhance integration of Global and Local models. #2403

Open davide-burba opened 3 weeks ago

davide-burba commented 3 weeks ago

Is your feature request related to a current problem? Please describe.

When using a mixture of local and global models, the user needs to distinguish the model types.

Here's a list of practical examples:

Describe proposed solution

dennisbader commented 3 weeks ago

Hi @davide-burba, and thanks for writing.

There are a few design choices that we made in Darts:

For these reasons, and to avoid any unexpected behavior, we believe it's best to not extend the models to work on multiple series.

Ensembles support a mixture of local and global models when calling the historical_forecasts method, but not when calling the fit method.

It's not clear if global models are effectively trained on multiple time-series when using the historical_forecasts method, especially when using ensembles.

davide-burba commented 3 weeks ago

Hi @dennisbader, thank you for the explanations :)

I see your point about having a unified API that allows to predict unseen time-series with global models, which indeed wouldn't work for local models.

However, I still think that a wrapper storing one local model per time-series is a valid alternative. There are already several consistency checks in the "pipeline", such as:

For this reason, I think that an additional consistency check to verify if the local models wrapper is predicting a time-series on which it was trained on would not be a big issue, and it might even simplify things down the line for ensembling.

Anyway, this is just my impression/feedback, I haven't checked the code and the implementation might not be trivial.