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
Model serialization? #524
Comments
Hey @dwilson1988, thanks for the kind words. So there's been an open issue in lifelines for a while around that point: #188 (pickle is a library to serialize python objects) There's not a good solution atm, unfortunately. However, in a later release, I will come back to fix this. |
I've written custom reduce methods for metaclasses before, would you be interested in a PR if I can break off some time to work on this? |
yesss so interested! |
So after inspection of the code, I see why this is an issue. Since the predict/divide/subtract methods are dynamically generated, they are unpicklable. I see two directions to go.
Thoughts? |
I'd prefer 2. - I don't like the additional dependency to clean up bad software architecture (I can say that because I wrote it heh) |
:) In progress, I'll send you a PR when I have it complete. |
If you can, feel free to work off my v0.15 branch (or point your contributions to branch |
Awesome, working on v0.15.0 |
Aha, I get it. You were trying to avoid rewriting docstrings because they are the same for the most part. A lot of docstrings are writable, but method docstrings aren't. You also can't modify the class |
I think a bit of over-engineering on my part, I feel |
I'd be just as happy with a "no-nonsense under-engineered" solution too |
I like clever code that saves lines of code, but perhaps "Explicit is better than implicit" is a good call here. I'm almost done either way, should have the PR in soon. Thanks! |
First off - AWESOME library. I've been using it for a few of my projects and it's been a lifesaver.
However, I'm looking to save models. I can't seem to find any documentation on how. My specific use case is just wanting to save the Kaplan-Meier estimator and use it to make predictions later. I can of course save off the data frame of the survival function, but I'd like to pickle (or otherwise) the model and reload in a different module as I'm performing analysis/fitting and then using the model later. Is there another way besides exporting the survival function (I'd like use the predict method...)
Thanks!
The text was updated successfully, but these errors were encountered: