<div dir="ltr"><div><div><div>Dear PYMVPA experts,<br><br></div>I plan to use PYMVPA to classify 2 groups of subjects (patients and controls). The inputs are betas  that come from the FSL- based analysis (i.e., cope.nii.gz). I use the SVM classifier in a specific mask on 100 selected features.<br><br>Could you please confirm that a short script below is correct:<br><br></div># copes  are taken from /subject/feet/reg_standard/stats/ folder for each subject.  For this example, they were copied to sub001, sub002, etc folders. There is a total of N=10 subjects (in this example).<br></div># I assume that each subject in a group is a chunk. Is that correct? <br><div><br>##################################<br><br>from glob import glob<br>import os<br>import numpy as np<br>from mvpa2.suite import*<br><br>labels=['hc','hc','hc','hc','hc','pt','pt','pt','pt','pt']<br>chunks=[1,2,3,4,5,1,2,3,4,5]    # Subject numbering within each group<br><br>copes=sorted(glob('/path/to/data/sub0*/cope14.nii.gz'))   # Collect file names <br>mask_fname="/path/to/data/my_mask.nii.gz"<br><br>db=fmri_dataset(copes, targets=labels, chunks=chunks, sprefix=None, tprefix=None, mask=mask_fname, add_fa=None)<br>ds_mni = vstack(db)<br><br># Setup classifier - is in the Hyperalignment example <br>clf = LinearCSVMC()<br><br># feature selection helpers<br>nf = 100<br>fselector = FixedNElementTailSelector(nf, tail='upper',<br>                                      mode='select', sort=False)<br>sbfs = SensitivityBasedFeatureSelection(OneWayAnova(), fselector,<br>                                        enable_ca=['sensitivities'])<br># create classifier with automatic feature selection<br>fsclf = FeatureSelectionClassifier(clf, sbfs)<br>cv = CrossValidation(fsclf,<br>                     NFoldPartitioner(),<br>                     enable_ca=['stats'])<br>                     <br>results = cv(ds_mni)<br>print results<br><br>##################################<br><br><br></div><div>Thank you,<br></div><div>Anna.<br></div><div><br></div></div>