[pymvpa] Searchlights and Permutation testing
Christopher J Markiewicz
effigies at bu.edu
Tue Jun 16 21:42:54 UTC 2015
On 06/16/2015 05:32 PM, Bill Broderick wrote:
> Hi Christopher,
> I think your method works, if I do the following
> for i in permutator.generate(ds):
I think this should be res.append(sl_gnb(i))?
> And then I combine all the resulting results in res. I couldn't make it
> work with a ChainNode containing a permutator and the sl_gnb; it would
> only run once, so I had to use the permutator explicitly as a generator.
Fair enough. I think there should be a way to chain together Measures,
even if ChainNode isn't it, but I don't know it off the top of my head.
> If I do things this way, there's no way to just permute the labels
> within the training data, right? Isn't it better to do that?
I'm not sure what you're asking. permutator.generate(ds) should be
permuting the labels of both training and testing data prior to exposing
them to sl_gnb.
> I also don't understand, if the gnbsearchlight is not seeing the
> permutator, how its implementation is saving time. It has to do that
> pre-calculation on each permuted dataset, right? Does it just take that
> much less time to run a gnbsearchlight through the brain on each dataset?
Yes, I believe that's correct. It is not saving time by preserving
computations across permutations, but within each searchlight analysis
it is faster than other types of searchlight.
> I had also gotten permutation testing working with a linear SVM, using
> the following:
> repeater = Repeater(count=number_of_permutations)
> permutator =
> nf = NFoldPartitioner()
> clf = LinearCSVMC()
> null_cv =
> distr_est =
> cv = CrossValidation(clf,nf,null_dist=distr_est)
> sl =
> res = sl(ds)
> Is there anything wrong with doing it this way? Other than it just
> taking a very long time.
That looks reasonable to me, but I defer to anybody who might gainsay
me. I did permutation testing by saving a new result file for every
permutation, so I have no experience with MCNullDist and the like.
> I would still need to make sure to pass on the null_prob from cv to sl
> to res, and I can't figure out how to pass the null distribution, if
> that's something I decide to do. I'm leaning towards not saving the null
> distribution -- it's good to know it's feasible but I'm not sure it's
> worth it. I didn't have any specific plans to use it, I just wanted to
> have it around in case it turned out to be useful.
Christopher J Markiewicz
Ph.D. Candidate, Quantitative Neuroscience Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 455 bytes
Desc: OpenPGP digital signature
More information about the Pkg-ExpPsy-PyMVPA