[pymvpa] Feature selection using sensitivity analysis and passing features for cross-validation
Nick Oosterhof
nikolaas.oosterhof at unitn.it
Sun Dec 29 16:48:08 UTC 2013
On Dec 29, 2013, at 4:46 PM, Arman Eshaghi wrote:
> I'm confused on how to pass selected features from SVM sensitivity analysis into another SVM for cross validation and performance measurement. [...] 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'))
The first argument of the feature selection has to be a sensitivity analyzer (of class FeaturewiseMeasure); it cannot be 'just' a classifier
You could try:
sensana=clf.get_sensitivity_analyzer()
and provide sensana as the first argument to SensitivityBasedFeatureSelection.
More information about the Pkg-ExpPsy-PyMVPA
mailing list