Save the trained models
niyuzheno1 opened this issue · 5 comments
Hi,
I have a quick question. How do we save the trained lightautoml model? After reading the documentation, it seems to me that there is no way for us to save the model without using things like pickle.
Hi @niyuzheno1 ,
Are you looking for a specific way to save models?
Hi @niyuzheno1,
To save the model you can use joblib.dump(automl, ‘model.pkl’)
.
To load the model you can use automl=joblib.load(‘model.pkl’)
Both these commands need import joblib
at the begging of the script.
I want to save my model whenever a submodel is trained. More specifically, I want to have the functionality that suppose we have models such as lgb, lgb_tuned, linear_l2, cb
. Whenever one of the models get trained, we will save the current version of the model.
@niyuzheno1 I wonder if this article might further your cause? AnalyticsIndiaMag - Custom Pipeline
@niyuzheno1 we have investigate different ideas about saving the models separately, but it's just not possible because LightAutoML is not just the models - it's the full pipeline from the raw data to the predictions and even further. That's why we save the whole pipeline at the end and use it for the prediction.