This message was deleted.
# mlforecast
s
This message was deleted.
j
Hey, welcome! • mlforecast and statsforecast can handle different lengths. In hierarchical there are some methods that require them to be of the same length. • statsforecast trains one model per serie. mlforecast trains one model for all series. Both have a cross_validation method that takes arguments to control the windows, e.g.
input_size
allows you to define the size of the training set to build a sliding window, which will advance
step_size
periods each time. If you don't specify input_size then they will use an expanding window. • We don't have any functions to ensemble models but you can follow this tutorial and use a similar logic to choose weights for an ensemble. • mlforecast provides an update method that will update the series so that if you call predict again it uses those, however the models aren't retrained. If you want to update the model you could for example use lightgbm and perform incremental learning, similar to what we do in the custom training guide.
g
Hello @José Morales, thank you for your reply. Just a few more questions to understanding what you have mentioned. > Both have a cross_validation method that takes arguments to control the windows, e.g.
input_size
allows you to define the size of the training set to build a sliding window, which will advance
step_size
periods each time. If you don't specify input_size then they will use an expanding window. • In a scenario where I have a data set that contain series of 2 product sales which are of different length (e.g. product A has 12 rows of data, product B has 72 rows of data). I want to control both
input_size
and
step_size
in the cross validation process of each series (e.g. 3 folds for product A and 10 folds for product B), and at the same time, want to use a single model to train both of the series. Is that possible? • From the cross validation guide here it shows a standard and same sliding window configuration applied to each series in df. > mlforecast provides an update method that will update the series so that if you call predict again it uses those, however the models aren't retrained. If you want to update the model you could for example use lightgbm and perform incremental learning, similar to what we do in the custom training guide. • Incremental learning is what I'm looking for. If I understand the guide correctly, by providing
sample_weights
of a lightgbm model trained on previous month (lgbmr_old) when training a new lightgbm model trained this month (lgbmr_new), the fitting process will be much faster because lgbmr_new is just training new data points. Since
sample_weights
are provided, lgbmr_new will not be training on old data. • How can I get the weights from a trained model?
j
• That's not possible, all series use the same configuration. What CV does is call fit + predict in a for loop, so you can implement your splitting logic yourself and do that • You can make it an expanding window or rolling window and control how it advances with the arguments • No, that's a reference on how to use the model interfaces directly. What I meant by incremental learning is providing the trained model to the
init_model
argument of fit in LightGBM for example, that way you can train the model some more iterations with your new data. • The trained models are stored in the
MLForecast.models_
attribute, so you can use their interfaces to get whatever you need