[pymvpa] Feature selection using sensitivity analysis and passing features for cross-validation

Arman Eshaghi arman.eshaghi at gmail.com
Sun Dec 29 15:46:35 UTC 2013


Dear all,

I'm confused on how to pass selected features from SVM sensitivity analysis
into another SVM for cross validation and performance measurement.I use
HalfPartitioner to tell the SVM to divide data into training and testing
groups based on 'chunks'. Here is my script

# from mvpa2.tutorial_suite import *
# clf=LinearCSVMC()
# attr = SampleAttributes(os.path.join('/my/path/', 'attributes.txt'))
# ds= fmri_dataset(samples='/path/to/samples.nii.gz', targets=attr.targets,
chunks=attr.chunks )
# fsel = SensitivityBasedFeatureSelection(clf,
FixedNElementTailSelector(1000, mode='select', tail='upper'))
# fclf = FeatureSelectionClassifier(clf, fsel)
# cvte = CrossValidation(fclf, HalfPartitioner(attr='chunks'),
enable_ca=['stats'])
# results = cvte(ds)

It ends up with this error:

ValueError: Feature selectors cannot handle multiple sequences in a
Dataset at once.  We got dataset <Dataset: 35x1@|S1, <sa: targets>> as
input


I can work with OneWayAnova() feature selector (as described in the
tutorial page) with no problem, but here I get confused when I try to
generalize the idea to another classifier


There are two useful discussion on the list regarding a similar problem here:

http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/2008q3/000085.html

and here:
http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/2012q3/002181.html

So I think I have done my homework, but I can not still make it to work.

Thanks in advance for any inputs.

All the best,
Arman

p.s I use fmri_dataset above but in fact my data is pre-processed (and
normalized) structural GM segments, and I have used the concept of
chunk to divide data into groups.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20131229/831b77a9/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list