[pymvpa] RPy and ENET

tg at cs.york.ac.uk tg at cs.york.ac.uk
Sun Jan 10 14:00:28 UTC 2010


Hi Per,

Thanks for the reference, the GLMNET option looks good.

Tara

> Hi Everyone:
>
> I've committed an updated GLMNET to my per/master branch, along with
> some tests.  It seems to be working on my end.
>
> Michael and Yarik, there is one very minor change remaining that I
> didn't understand how to do.  Can whoever wrote (or knows the inner
> workings of) the function externals.exists let me know what to do with
> rpy2?  There's some code in there for reporting rpy exceptions and I
> don't know what the equivalent is for rpy2.
>
> Tara, given that you wanted to use ENET, you should be able to do the
> same with GLMNET by setting the alpha parameter to something less than
> 1.0.  I've found that picking parameter values for GLMNET is much
> easier than for ENET because it's bounded.  You can also try out the
> pmax parameter to control the upper bound of features it will keep.
> Finally, GLMNET is way cool because you can use it to do both
> multinomial classification (GLMNET_C) and regression (GLMNET_R).  The
> following paper is definitely worth a read:
>
>     Friedman, J., Hastie, T. and Tibshirani, R. (2008) Regularization
>     Paths for Generalized Linear Models via Coordinate
>     Descent. http://www-stat.stanford.edu/~hastie/Papers/glmnet.pdf
>
> Thanks, enjoy, and please let me know if there are any issues you run
> into.
>
> Best,
> Per
>
>
> At Sat, 09 Jan 2010 22:32:20 +0000,
> Tara Gilliam wrote:
>>
>> > If no one objects, I'll go ahead and implement all this.  Let me know
>> > if you have suggestions for other ways I should go about handling this
>> > rpy business...
>>
>> Hi Per,
>>
>> Thanks for looking into this! I'm very busy next week, but after that
>> I'd be happy to test out any changes if needed.
>>
>> Tara
>>
>>
>> >>
>> >>> On 12/21/09, Yaroslav Halchenko <debian at onerussian.com> wrote:
>> >>>> Hi Tara,
>> >>>>
>> >>>> Unfortunately switch to (support of) Rpy2 is only in our plans and
>> we
>> >>>> haven't touched it at all yet.
>> >>>>
>> >>>> I will check it out later on today if we could just use
>> >>>> rpy-compatibility layer in rpy2 for now... I will update you
>> >>>>
>> >>>> On Mon, 21 Dec 2009, Tara Gilliam wrote:
>> >>>>
>> >>>>> Hello,
>> >>>>> When I try to import the ENET classifier, I get an dependency
>> error
>> >>>>> about rpy being unavailable (PyMVPA version 0.4.3).
>> >>>>> I can 'import rpy2', but not 'import rpy' - is it definitely the
>> >>>>> original RPy that is required, or will RPy2 also work? The system
>> I
>> >>>>> am on is university-administered with RPy2 installed, and rpy does
>> >>>>> not work with our current version of R. So if possible I would
>> >>>>> prefer not having to install a lot of (unsupported) dependencies
>> for
>> >>>>> just this classifier item.
>> >>>>> Looking further, the segment of code seems to be this
>> (clfs/enet.py,
>> >>>>> lines
>> >>>>> 18-22):
>> >>>>> # do conditional to be able to build module reference
>> >>>>> if externals.exists('rpy', raiseException=True) and \
>> >>>>>    externals.exists('elasticnet', raiseException=True):
>> >>>>>     import rpy
>> >>>>>     rpy.r.library('elasticnet')
>> >>>>
>> >>>>> From the Rpy2 documentation, there seems to be a sort of
>> Rpy-compatible
>> >>>>> mode:
>> >>>>> from http://rpy.sourceforge.net/rpy2/doc/html/rpy_classic.html,
>> >>>>> allowing
>> >>>>> e.g.
>> >>>>> import rpy2.rpy_classic as rpy
>> >>>>> rpy.r.library('splines')
>> >>>>> Do you know of any (e.g. version-specific) issue that would
>> prevent
>> >>>>> a local patch to the import statement from working here? Are there
>> >>>>> any plans to switch PyMVPA to RPy2?
>> >>>>> Many thanks,
>> >>>>> Tara
>> >>>>
>> >>>>> _______________________________________________
>> >>>>> Pkg-ExpPsy-PyMVPA mailing list
>> >>>>> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
>> >>>>> http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa
>> >>>>
>> >>>> --
>> >>>>                                   .-.
>> >>>> =------------------------------   /v\
>> ----------------------------=
>> >>>> Keep in touch                    // \\
>> (yoh@|www.)onerussian.com
>> >>>> Yaroslav Halchenko              /(   )\               ICQ#:
>> 60653192
>> >>>>                    Linux User    ^^-^^    [175555]
>> >>>>
>> >>>>
>> >>>>
>> >>>> _______________________________________________
>> >>>> Pkg-ExpPsy-PyMVPA mailing list
>> >>>> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
>> >>>> http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa
>> >>>>
>> >>
>>
>> _______________________________________________
>> Pkg-ExpPsy-PyMVPA mailing list
>> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa
>





More information about the Pkg-ExpPsy-PyMVPA mailing list