[pymvpa] problem with reverse mapper

Nick Oosterhof n.n.oosterhof at googlemail.com
Wed Apr 22 13:57:41 UTC 2015

On 22 Apr 2015, at 15:22, Serin Atiani, Dr <serin.atiani at mail.mcgill.ca> wrote:

> I am doing basic analysis, mostly following the steps of the tutorial. I am trying to reverse the mappers in order to project the features I am interested in back into Nifti file. I am getting the error below. Any thoughts what I am doing wrong?
>>>> print fds_p.a.mapper
> <Chain: <Flatten>-<StaticFeatureSelection>-<PolyDetrend: ord=1>-<ZScore>-<Fx: fx=mean>>
>>>> fds_p.nfeatures
> 500
>>>> revtest=np.arange(100, 100+fds_p.nfeatures)

The size of revtest does not match that of what is expected by the mapper, because it’s shape should be (N,fds_p.nfeatures) [where N is the number of samples], i.e. a matrix with 100 columns. np.arange(100,100+fds_p.nfeatures) produces a vector with shape (fds_p.nfeatures,).

Can you try:

revtest=np.arange(100, 100+fds_p.nfeatures)[np.newaxis]

More information about the Pkg-ExpPsy-PyMVPA mailing list