[pymvpa] between-subject classification

Yaroslav Halchenko debian at onerussian.com
Tue Sep 26 17:27:11 UTC 2017


On Tue, 26 Sep 2017, Anna Manelis wrote:

> Dear PYMVPA experts,

> 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.

> Could you please confirm that a short script below is correct:

> # 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).
> # I assume that each subject in a group is a chunk. Is that correct?



> from glob import glob
> import os
> import numpy as np
> from mvpa2.suite import*

> labels=['hc','hc','hc','hc','hc','pt','pt','pt','pt','pt']
> chunks=[1,2,3,4,5,1,2,3,4,5]    # Subject numbering within each group

> copes=sorted(glob('/path/to/data/sub0*/cope14.nii.gz'))   # Collect file

looks correctish assuming that your subjects ordered that there is first
5 hc's and then 5 pt's

-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        



More information about the Pkg-ExpPsy-PyMVPA mailing list