[pymvpa] Searchlight Permutation Testing with Monte Carlo Selection
jessi.goold at gmail.com
Wed Jan 31 20:44:28 UTC 2018
Thanks in advance for the help.
I am trying to create a monte carlo permutation distribution to test my
group searchlight against, but am worried that I set it up wrong and am
also not sure where to go from here.
Currently, I have 40 subjects with 15 permuted searchlights per subject as
well as the actual searchlights which I want to test against the permuted
distribution all saved as nifti files. I just created different permuted
attribute files and did each permuted searchlight one by one across 3
computers in the lab to try to speed up the process, but now I'm not sure
how to recombine everything and do the actual monte carlo distribution.
What I've found online in the PyMVPA manual has the permutator and
estimator within the cross validation script so I'm worried I may need to
redo everything which will take another month or longer to do on one
computer in my lab.
Long story short, is there a way to create a monte carlo distribution with
searchlights that have already been created and what's the best way to do
Here is the code I used for one permuted searchlight, I'm also worried I
didn't save all the information I needed, can someone let me know if that
is the case?
from mvpa2.suite import *
import numpy as np
import scipy.stats as sp
path = '/Users/Desktop/SearchlightPermutation/'
for sub in subjects:
verbose(1,'processing subject: %s'%sub)
attr = SampleAttributes(os.path.join(path, 'Attributes11thIt.txt'))
fds = fmri_dataset(samples=os.path.join(path,
'Beta_allStim_sub%s.nii'%sub), targets = attr.targets, chunks=attr.chunks,
mask = os.path.join(path, 'mask_anat.sub%s.nii'%sub))
#zscore detrended data
#set up classifier
clf = LinearCSVMC()
cvte = CrossValidation(clf, NFoldPartitioner(), errorfx=lambda p, t:
np.mean(p == t), enable_ca=['stats'])
sl = sphere_searchlight(cvte, radius=3, space='voxel_indices',
res = sl(fds)
niftiresults = map2nifti(fds,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pkg-ExpPsy-PyMVPA