rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.9k stars 868 forks source link

`load` and `save` methods for estimators #32

Open rasbt opened 8 years ago

rasbt commented 8 years ago

Add load and save methods to classifiers and regressors using JSON to avoid common pickle issues / platform incompatibilities -- based on https://github.com/rasbt/python-machine-learning-book/blob/master/code/bonus/scikit-model-to-json.ipynb

eyadsibai commented 8 years ago

will this work for all estimators in scikit-learn?

rasbt commented 8 years ago

I think it should work, haven't had a chance to try it for all estimators, yet. This would require good and extensive unit tests for sure! Btw. there was a good follow-up post here about this topic: https://cmry.github.io/notes/serialize

eyadsibai commented 7 years ago

I am willing to help to make this happen!

rasbt commented 7 years ago

Thanks for your willingness to help, Eyad! I really appreciate it! I think this is not an easy thing though, and implementing it as an method as I initially stated in this issue (i.e., modifying estimators) may not be the ideal way to go. I think implementing functions such as save_estimator / load_estimator (or save_sklearn_estimator / load_sklearn_estimator) may be something that could be appropriate for this kind of thing. In this case, the 'utils' section of mlxtend seems to be an appropriate choice I guess :)