On 21/12/09 08:36, JJ wrote:
> Hello:
> I am using the gbm package and want to save the model returned after calling
> the function gbm via rpy2. For example,
> r.library('gbm')
> gbm = robjects.r['gbm']
> myModel = gbm(data)
>
> My question is, how can I save myModel such that I can later reload it in
> python and it is useable (for example, to send as an argument to other R
> functions, such as predict())? I get an error if I use:
> r.save(mymodel, file=datafile)
> and if I pickle myModel directly in python it turns out to be a very small
> file size (it should be very large).
>
What is the version of rpy2 you are using ?
Pickling should be working with rpy2-2.1-dev, using the R "save" system
for the R component
(http://rpy.sourceforge.net/rpy2/doc-dev/html/robjects.html#object-serialization).
If this does not appear to be working, can you provide a self-contained
snippet of code
(off-list if you prefer it) ?
L.
> Any ideas?
>
> Thanks
> John
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> rpy-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rpy-list
>
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list