Sklearn - model persistence without pkl file

I am interested in saving a model created in Sklearn (e.g. EmpiricalCovariance, MinCovDet or OneClassSVM) and subsequent reapplication. I am familiar with the ability to save a PKL file and joblib, however I would prefer to save the model explicitly rather than a serialized python object. The main motivation for this is that it makes it easy to view model parameters.

I found one link for this: http://thiagomarzagao.com/2015/12/07/model-persistence-without-pickles/

Question: Can I count on this work over time (i.e. new versions of sklearn)? Is this too much of a hacking solution?

Does anyone have any experience?

Thanks Jonathan

0
source share
1 answer

I don’t think this is a hacked decision, a colleague did a similar thing where he exports a model that will be consumed by a scorer who is written in golang, and much faster than scikit-learn scorer. If you are concerned about compatibility with future versions of sklearn, you should consider using an environment manager such as conda or virtualenv ; anyway, it's just good software development practice and something you should get used to with.

+1
source

Source: https://habr.com/ru/post/1269767/


All Articles