sberbank-ai-lab / LightAutoML

LAMA - automatic model creation framework
Apache License 2.0
893 stars 92 forks source link

Save the trained models #84

Closed ghost closed 2 years ago

ghost commented 3 years ago

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.

dev-rinchin commented 3 years ago

Hi @niyuzheno1 ,

Are you looking for a specific way to save models?

alexmryzhkov commented 2 years ago

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.

ghost commented 2 years ago

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.

AlexanderLavelle commented 2 years ago

@niyuzheno1 I wonder if this article might further your cause? AnalyticsIndiaMag - Custom Pipeline

alexmryzhkov commented 2 years ago

@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.