2012/1/31 David Warde-Farley <[email protected]>:
> On Tue, Jan 31, 2012 at 02:08:21PM -0500, Jeff Farris wrote:
>> I'm currently using pickle to persist models (e.g. SVC).   After upgrading
>> sklearn, these pickled models from a previous version of sklearn don't tend
>> to work and then I need to retrain.  Is there some version independent way
>> of saving models  (e.g. libsvm model format) or other recommendations on
>> how to go about doing this without retraining all my persisted models after
>> each sklearn upgrade?
>
> You could pull out the individual learned parameters and save them as NPY
> files with numpy.save.

Note that you can use `sklearn.externals.joblib.dump` for that. The
current version can even compress the arrays.

> Ideally, object implementations would be versioned and their __setstate__()
> would be able to de-persist old objects, but it's a significant maintenance
> burden.

I am -1 for that solution. That would be a lot of boilerplate to
maintain. I prefer external serializers like joblib or a PMML exporter
that  keep that logic out of the code.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to