Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to save/serialize model: WeibulAFTFitter #1138

Closed
torresxavier opened this issue Sep 20, 2020 · 3 comments
Closed

How to save/serialize model: WeibulAFTFitter #1138

torresxavier opened this issue Sep 20, 2020 · 3 comments

Comments

@torresxavier
Copy link

torresxavier commented Sep 20, 2020

Hi there! Nice library this one! I have trained a model using WeibullAFTFitter and would like to reuse it without training it again... I've tried with the suggestions given in the documentation (pickle, dill, and also joblib...) but it keeps on throwing the same mistake:

" Sorry, pickling not yet supported. See pydata/patsy#26 if you want to help."

If I try with the CoxPH model it works, but not under the WeibullAFTFitter. And the last one is the one showing best performance so I need to save it to disk.

Any thoughts on how to save/serialize a trained WeibullAFTFitter model for future usage?

Thanks

@CamDavidsonPilon
Copy link
Owner

Hi @torresxavier, there was a recent regression in the latest lifelines: in order to support formulas (which, I am guessing you are using), we had to sacrifice some serialization. However, a solution is coming soon, in #1131 - should only be a few weeks.

If you are comfortable with pip, you can do pip install https://github.com/CamDavidsonPilon/lifelines/archive/try-formulaic.zip to install a working lifelines with full support for serialization.

@torresxavier
Copy link
Author

I'll check that. Thanks @CamDavidsonPilon !!!

@CamDavidsonPilon
Copy link
Owner

This is now native in lifelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants