[pymvpa] using Balancer()

Michael Hanke mih at debian.org
Thu Jul 26 12:51:54 UTC 2012


On Wed, Jul 25, 2012 at 03:11:47PM -0400, Edmund Chong wrote:
> Hi all,
> Currently I have unbalanced samples in each run (unequal number of samples
> per condition).
> If I do leave-one-run-out classification, am I correct to use the following
> partitioner in my classifier to ensure an equal number of samples per
> condition, for each classification fold?
> ChainNode([NFoldPartitioner(),Balancer(attr='targets',count=1,limit='partitions',apply_selection=True)],space='partitions'))

Looks good. If you want to check it yourself, you can also call
.generate() of this chain node with you dataset and print .summary() of
the datasets it returns.

> Also, what happens if in some runs, I have no trials for a certain
> condition? I imagine that on folds where those runs are part of the "test
> dataset", this would be problematic (nothing to test against)?  So are
> those fold entirely excluded from the analysis if I use Balancer?

I don't think it would exclude any runs entirely, but you would be
lacking something to test on, indeed.


Michael Hanke

More information about the Pkg-ExpPsy-PyMVPA mailing list