[pymvpa] Searchlights and additional measures

John Clithero john.clithero at gmail.com
Tue Aug 18 23:51:13 UTC 2009


Hi all,

I am new to PyMVPA, but so far I am really enjoying it.  I have it up
and running on Ubuntu, and I have some (very) basic questions.
I am trying to analyze some fMRI data and had been using just LIBSVM
(simple two-class problem).  I would like to accomplish the following
using searchlights over the entire brain:

(1) Collect CV rate for each searchlight using standard N-fold (this
was not a problem).
(2) Construct confusion matrix for each searchlight and save them all.
(3) Save averaged (across the folds) SVM weights for all of the searchlights.

Is it possible to accomplish all three with a single pass through
Searchlight, or will I need to do (2) and (3) separately? Although
both PyMVPA papers have been very helpful, I was unable to put these
particular pieces together...what is the best way to go about this?
I have successfully run searchlights, but only a simple saving of CV
rates. If it helps, I have copied over some lines (but not all!) that
might make it easier for someone to help me determine the correct
sequence...
The package is really great, and I am looking forward to using more of
it (once I learn!).

Cheers,
John
---------------------------


##Load fMRI data (not a problem)##

##Splitter##
splitter = NFoldSplitter(cvtype=1)

##Classifier##
clf = LinearCSVMC()
sclf = SplitClassifier(clf, splitter, enable_states=['confusion',
'training_confusion'])

##CV##
cv = CrossValidatedTransferError(TransferError(clf), splitter,
harvest_attribs=['transferror.clf.getSensitivityAnalyzer(force_training=False,','transformer=N.abs)'],enable_states=['confusion',
'training_confusion'])

##Searchlight???##
sl = Searchlight(cv, radius=10)



More information about the Pkg-ExpPsy-PyMVPA mailing list