[pymvpa] Error running dissimilarity analysis

Michael Hanke michael.hanke at gmail.com
Wed Dec 16 22:15:03 UTC 2009


Hey,

[ sorry for the delay ]

On Wed, Dec 16, 2009 at 12:04:28PM +0100, Valentin Haenel wrote:
> Would anyone of the senior developers like to comment on this, please.

You're senior too -- no? ;-)

> * Michael W. Cole <mwcole at gmail.com> [091214]:
> > Hello Valentin,
> > 
> > Thanks for the reply.
> > 
> > I'm including the requested info:
> > PyMVPA 0.4.3 on Fedora 10 x86_64.
> > 
> > Here is the relevant part of the script:
> > 
> >     blockavged_dataset = NiftiDataset(samples=niftiFile,
> > >         labels=attrs.labels, chunks=attrs.chunks, labels_map={'cat1': 0,
> > > 'cat2': 1, 'cat3': 2, 'cat4': 3, 'cat5': 4},
> > >         mask=maskFile)
> > >
> > >     # remove first category from dataset
> > >     blockavged_dataset = blockavged_dataset.selectSamples(N.array([l != 0
> > > for l in blockavged_dataset.labels],
> > >                                             dtype='bool'))
> > >
> > >     """Create a dissimilarity matrix based on the labels of the data points
> > >     in our test dataset.  This will allow us to see if there is a
> > > correlation
> > >     between any given searchlight sphere and the experimental
> > > conditions."""
> > >
> > >     # create dissimilarity matrix using the 'confusion' distance
> > >     # metric
> > >     dsm = DSMatrix(blockavged_dataset.labels, 'confusion')
> > 
> > 
> >     #
> > >     # Run Searchlight
> > >     #
> > >
> > >     # choose classifier
> > >     dsmetric = DSMDatasetMeasure(dsm, 'pearson', 'pearson')
> > >
> > >     for radius in [6.4,9.6]:
> > >
> > >         # tell which one we are doing
> > >         print "Running searchlight with radius: %.2fmm..." % (radius)
> > >
> > >         # setup Searchlight with a custom radius
> > >         # radius has to be in the same unit as the nifti file's pixdim
> > >         # property.
> > >         sl = Searchlight(dsmetric, radius=radius)
> > >
> > >         # run searchlight on example dataset and retrieve error map
> > >         sl_map = sl(blockavged_dataset)



More information about the Pkg-ExpPsy-PyMVPA mailing list