Nixtla / mlforecast

Scalable machine 🤖 learning for time series forecasting.
https://nixtlaverse.nixtla.io/mlforecast
Apache License 2.0
808 stars 75 forks source link

Does mlforecast train a single global model or one model per serie? #299

Closed kkckk1110 closed 5 months ago

kkckk1110 commented 6 months ago

Hello! I found MLforecast really helpful. But I have a question about the model and training process. I followed the tutorial and trained XGBoost on my dataset, which consisted multiple time series. I wonder that, when training, do the time series with different ids share some parameters or training process? How does it work? Or could you please kindly refer to some documents where I can find some cues.

I tried to train the model on the whole dataset and train on a single time series alone. I found that, when I only input a time series to the model, the model produced better performance. Therefore, I am curious about the detailed training pipeline.

Thanks for your attention!

jmoralez commented 6 months ago

Hey @kkckk1110, we're glad you're finding it useful. A single model is trained using all of the series because it's usually the best performing approach (also the most efficient). If your series are very different you can try using the id as a feature, i.e. setting static_features=['unique_id'] in the fit method which might help (for XGBoost you have to set some arguments to enable categorical support).

github-actions[bot] commented 5 months ago

This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one.