[pymvpa] RFE question #2 - (longer) version

Mark Lescroart lescroar at usc.edu
Tue Nov 24 19:47:49 UTC 2009


Hello again,

Thanks for the quick response!

I'm using pyMVPA version 0.4.2 (which I installed last August). Should  
I upgrade to 0.4.3? Is that as simple as " sudo port update py25- 
pymvpa" ?
(I'm generally leery of changing versions mid-project, but I'll do it  
if it will fix this problem).

As to the problem: your modification of my code (using  
datasets['uni4large'] instead of my data ("PyDat")) gave an error, so  
I take it that the problem isn't with my data set:

[RFEC] DBG:       Step 0: nfeatures=20
[RFEC] DBG:       Step 0: nfeatures=20 error=0.0833 best/stop=1/0
[RFEC] DBG:       Step 1: nfeatures=3
[RFEC] DBG:       Step 1: nfeatures=3 error=0.3333 best/stop=0/0
Traceback (most recent call last):
   File "./bug_rfe.py", line 40, in <module>
     Err = cvterr(datasets['uni4large'])
   File "/opt/local/lib/python2.5/site-packages/mvpa/measures/ 
base.py", line 105, in __call__
     result = self._call(dataset)
   File "/opt/local/lib/python2.5/site-packages/mvpa/algorithms/ 
cvtranserror.py", line 173, in _call
     result = transerror(split[1], split[0])
   File "/opt/local/lib/python2.5/site-packages/mvpa/clfs/ 
transerror.py", line 1283, in __call__
     self._precall(testdataset, trainingdataset)
   File "/opt/local/lib/python2.5/site-packages/mvpa/clfs/ 
transerror.py", line 1239, in _precall
     self.__clf.train(trainingdataset)
   File "/opt/local/lib/python2.5/site-packages/mvpa/clfs/base.py",  
line 354, in train
     result = self._train(dataset)
   File "/opt/local/lib/python2.5/site-packages/mvpa/clfs/meta.py",  
line 1058, in _train
     self.__testdataset)
   File "/opt/local/lib/python2.5/site-packages/mvpa/featsel/rfe.py",  
line 268, in __call__
     wdataset = wdataset.selectFeatures(selected_ids)
   File "/opt/local/lib/python2.5/site-packages/mvpa/datasets/ 
base.py", line 1018, in selectFeatures
     new_data['samples'] = self._data['samples'][:, ids]
IndexError: index (4) out of range (0<=index<2) in dimension 1


print PyDat.summary() gives:

Dataset / float32 440 x 649
uniq: 8 chunks 3 labels
stats: mean=-3.86503e-09 std=0.999965 var=0.99993 min=-4.09558  
max=4.98693

Counts of labels in each chunk:
   chunks\labels 1.0 2.0 3.0
                 --- --- ---
       1.0        19  18  18
       2.0        18  19  18
       3.0        18  19  18
       4.0        18  19  18
       5.0        18  19  18
       6.0        18  18  19
       7.0        18  19  18
       8.0        19  18  18

Summary per label across chunks
   label mean  std  min max #chunks
    1    18.2 0.433  18  19    8
    2    18.6 0.484  18  19    8
    3    18.1 0.331  18  19    8

Summary per chunk across labels
   chunk mean  std  min max #labels
    1    18.3 0.471  18  19    3
    2    18.3 0.471  18  19    3
    3    18.3 0.471  18  19    3
    4    18.3 0.471  18  19    3
    5    18.3 0.471  18  19    3
    6    18.3 0.471  18  19    3
    7    18.3 0.471  18  19    3
    8    18.3 0.471  18  19    3

Any further advice?

Cheers,

Mark

On Nov 24, 2009, at 10:42 AM, Yaroslav Halchenko wrote:

> Lets return back to the mailing list ;) might be of interest to public
>
> In general, classifier with RFE should behave as any other  
> classifier...
>
> See attached your exact code to use RFE-ed classifier (I've just  
> changed
> proportion to be removed to 50%, and enabling debugging output so
> we could get some basic progress information from RFE).  It runs  
> fine on
> test datasets for binary and multiclass...  So the problem might be
> indeed in dataset somehow?
>
> What does
>
> print PyDat.summary()
>
> say?
>
> What version of pymvpa do you use btw?
>
> as for
>>       raise UnknownStateError("Unknown yet value of %s" %  
>> (self.name))
>>   mvpa.misc.exceptions.UnknownStateError: Exception: Unknown yet  
>> value of
>>   feature_ids
> to access them you should have enabled 'feature_ids' of your  
> classifier,
> not of the RFE per se (just as I've done in the attached script)
>
> ;)
>
> -- 
> Yaroslav O. Halchenko
> Postdoctoral Fellow,   Department of Psychological and Brain Sciences
> Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
> Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
> WWW:   http://www.linkedin.com/in/yarik
> <bug_rfe.py>

~~~~~~~~~~~~~~~~~~~~~~~~~~

Mark Lescroart
(say it LESS-qua)

University of Southern California
Neuroscience Graduate Program
Image Understanding Lab
Email: mark.lescroart at usc.edu
Cell: (213) 447-0752




More information about the Pkg-ExpPsy-PyMVPA mailing list