Also, since you're using scikit-learn, you could try giving the joblib `dump` 
and `load` a go. Joblib is bundled with scikit-learn: `from 
sklearn.externals.joblib import dump, load`. They support various degrees of 
compression and were designed for saving large models.

Vlad
> 
> On Wed, Oct 17, 2012 at 1:31 PM, Niall Twomey <[email protected]> wrote:
> Hi all.
> 
> I want to save an array of models trained on lots of data to file. I have 
> tried the following code (roughly speaking anyway)
> models = []
> # Populate the list of models with dict items containing one number and PCA 
> and GMM models
> import pickle
> pickle.dump( "models.pickle", models )
> 
> but I get errors saying: 
> AttributeError: 'list' object has no attribute 'write'. 
> which presumably referrs to the models list. 
> 
> Saving them to file is crucial for me, but I have no idea how to proceed from 
> here. Any advice will be appreciated. 
> 
> Thanks. 
> 
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
> 

------------------
Vlad N.
http://vene.ro





------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to