Skip to content

Save the trained models #84

Closed
ghost opened this issue Oct 8, 2021 · 5 comments
Closed

Save the trained models #84

ghost opened this issue Oct 8, 2021 · 5 comments
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Oct 8, 2021

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
Copy link
Contributor

Hi @niyuzheno1 ,

Are you looking for a specific way to save models?

@dev-rinchin dev-rinchin added the question Further information is requested label Oct 8, 2021
@alexmryzhkov
Copy link
Contributor

alexmryzhkov commented Oct 8, 2021

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
Copy link
Author

ghost commented Oct 8, 2021

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
Copy link

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

@alexmryzhkov
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants