[pymvpa] problem running LARS (via rpy)

Epic John epicjohn at gmail.com
Thu Aug 27 02:39:13 UTC 2009

Hi All,

I was really happy to find pymvpa a few days ago. I like some of the
dataset/classifier abstractions that are present, and while I haven't
explored the entire package yet, I am eager to start using it more.

I ran into a problem running LARS, however (which was the original reason I
looked into pymvpa.) Part of this might stem from my relative lack of
knowledge of R/rpy, but I thought I should ask for some help here.

I am doing something really basic:

training = Dataset(samples=N.array( N.arange(100),ndmin=2,
                       labels=[0] * 50 + [1] * 50)

lrs = LARS()

That fails with an rpy exception, which basically tells me there is
something wrong with the types. I see we are passing a python ndarray as the
'x' argument of lars, which I am guessing is supposed to be converted
to an R matrix behind the scenes. At the end something bad happens when the
lars code invokes 'dim(x)'. I am using R 2.7.0, rpy-1.0.3. I have been able
to do basic things with rpy, such as plotting, which tells me my rpy/R
installation is fine. I have pasted the excetion I get at the end of the

Does anyone have any idea how to get LARS to work?



C:\Python25\lib\site-packages\mvpa\clfs\base.pyc in train(self, dataset)
    353         if dataset.nfeatures > 0:
--> 354             result = self._train(dataset)
    355         else:
    356             warning("Trying to train on dataset with no features

C:\Python25\lib\site-packages\mvpa\clfs\lars.pyc in _train(self, data)
    146                                               trace=self.__trace,
--> 147
    148         else:
    149             # train with specifying max_steps

RPy_RException: Error in rep(1, n) : invalid 'times' argument

WARNING: Failure executing file: <mvpa_test.py>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20090826/4bbb6266/attachment.htm>

More information about the Pkg-ExpPsy-PyMVPA mailing list