[pymvpa] PyMVPA Question

Yaroslav Halchenko debian at onerussian.com
Tue Oct 29 20:19:59 UTC 2013


you would need to use Balancer() in tandem with your NFoldPartitioner

e.g. use following partitioner

    partitioner = ChainNode([NFoldPartitioner(cvtype=1),
                             Balancer(attr='targets',
                                      count=1, # for real data > 1
                                      limit='partitions',
                                      apply_selection=True
                                      )],
                            space='partitions')

instead of plain NFoldPartitioner


On Tue, 29 Oct 2013, Taku Ito wrote:

>    Hi,
>    I'm currently running through PyMVPA my first time, and ran into question
>    I couldn't quite figure out straightforwardly through the manual.
>    The data set that I have currently has only two target labels, but the
>    number of labels for each of the targets are unequal. �I'm curious to try
>    and find a way to train and test the classifier on N-Fold subsets, where
>    each subsets have an equal number of labels for each target value. �
>    I'm currently constructing my CrossValidation object as such:
>    clf = LinearCSVMC()
>    cvte = CrossValidation(clf, NFoldPartitioner(),
>    � � � � � � � � � � � � � � � � errorfx=lambda p, t: np.mean(p == t),
>    � � � � � � � � � � � � � � � � enable_ca=['stats'])
>    I was thinking that maybe the 3rd parameter in the documentation, the
>    'Splitter' instance may be useful, but I was confused since the
>    documentation seems to indicate that it would split the attributes based
>    on the labels... �I also came across NFoldSplitter during my search (which
>    looked promising), but it seemed as if that object was no longer
>    supported. �Please let me know if you might have any insights!
>    Thanks,
>    Taku
-- 
Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Senior Research Associate,     Psychological and Brain Sciences Dept.
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