[pymvpa] SampleGroupMapper question

Yaroslav Halchenko debian at onerussian.com
Tue Jun 30 15:40:58 UTC 2009


On Tue, 30 Jun 2009, Matthias Ekman wrote:
> So far so good :-) Is it also possible to apply the same mapping to the  
> SamplesAttributes? Something like:
>
> mapped_attr = attr.applyMapper(samplesmapper=m)
Unfortunately not at the moment, BUT if it is needed, we will make it ;)

> I just want a new txt-file with the corresponding (mapped) attributes.  
> If nothing like this exists, it should be very easy to recode my  
> existing attributes file externally (bash, python whatever)... but... I  

yeah -- probably the best is to do that just right in that script of yours ;)
but indeed we should just adjust it so it could operate on any set of
sample attributes (which have unique values).  Would you mind sharing a
usecase why do you need that and what custom attribute do you create with
SamplesAttribute?


> was not able to find out how the mapper works internally. Especially  
hm... just look at the source code -- it is all there in 'forward'
method of the SampleGroupMapper

in ipython that is as easy as

SampleGroupMapper??

> what the the 'new sample' order looks like. Is it depending on the first  
> appearance of a sample in each chunk?
it is based on the order of uniquechunks and then uniquelabels. Here is
the actual code:

       mdata = []

        # for each label in each chunk
        for c in self.__uniquechunks:
            for l in self.__uniquelabels:
                mdata.append(self.__fx(data[N.logical_and(self.__labels == l,
                                                          self.__chunks == c)]))

        return N.array(mdata)

> Would be very nice to hear your opinion on the following questions:
> Would you perform the detrending before or after mapping?

usually it is worth to do ALL preprocessing first and store the preprocessed
data so you don't need to do that for every modification of your analysis.  I
don't think that detending after applying SampleGroupMapper would make any
sense since it does change the ordering of samples

> The samplemapping really improves my decoding accuracy very much. I  
> assume this is because of noise reduction? Could you think of another  
> reason which might be not intended?

could be many things, but most probably indeed just noise reduction. It
could also obliterate non-linear effects a bit imho.

-- 
                                  .-.
=------------------------------   /v\  ----------------------------=
Keep in touch                    // \\     (yoh@|www.)onerussian.com
Yaroslav Halchenko              /(   )\               ICQ#: 60653192
                   Linux User    ^^-^^    [175555]





More information about the Pkg-ExpPsy-PyMVPA mailing list