<div dir="ltr">Ah, that's great, thanks for the extra info.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 2:19 PM, Yaroslav Halchenko <span dir="ltr"><<a href="mailto:debian@onerussian.com" target="_blank">debian@onerussian.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On Tue, 16 Dec 2014, Nick Oosterhof wrote:<br>
<br>
<br>
> On 16 Dec 2014, at 14:37, Thomas Nickson <<a href="mailto:thomas.nickson@gmail.com">thomas.nickson@gmail.com</a>> wrote:<br>
<br>
> > The chunks are supposed to define sets that are independent but I'm not sure how to encode this. If I'm doing structural all of my scans are independent of each other right? So my chunks should just be an array of distinct numbers of the length of the number of subjects I have?<br>
<br>
> Indeed.<br>
<br>
> > Or is independence the same as the diagnosis groupings?<br>
<br>
> If you have different groups (e.g. patients and healthy controls) and you want to see if you can discriminate between these groups, you can encode this in the .sa.targets attribute.<br>
<br>
</span>The trick here though is still to "keep balance" since in most of the<br>
scenarios you might have relatively small number of samples so you would<br>
still like to have balanced groups (e.g. patients and controls) in<br>
training and testing to avoid possible "training winner takes it<br>
all" situation.<br>
<br>
Here e.g. the possible partitioning beast which would do smth like that<br>
if you assign a different chunk to every sample (since they are<br>
independent)<br>
<br>
mvpa2.seed(1)  # reproducible balancing<br>
partitioner = ChainNode([NFoldPartitioner(cvtype=2),<br>
                         Sifter([('partitions', 2),<br>
                                 ('targets',<br>
                                   dict(uvalues=['patient', 'control'],<br>
                                        balanced=True))]),<br>
                         Balancer(attr='targets',<br>
                                  count=1, # can set > 1 if you dont have "enough"<br>
                                  limit='partitions',<br>
                                  apply_selection=True<br>
                                 )],<br>
                            space='partitions')<br>
<br>
it would grab out all possible pairs of patient/controls, assure that they are<br>
balanced (have 1 patient, 1 control), balances out number of samples across<br>
groups through subselection (if you have e.g. more controls than patients;<br>
otherwise -- remove Balancer)<br>
<br>
related issue  which I hope one of us will tackle soon or you are welcome to<br>
contribute is <a href="https://github.com/PyMVPA/PyMVPA/issues/261" target="_blank">https://github.com/PyMVPA/PyMVPA/issues/261</a> which should provide<br>
"merged" NFoldPartitioner + Sifter  to avoid current inefficiency of the setup,<br>
and cumbersome construct ;)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Yaroslav O. Halchenko, Ph.D.<br>
<a href="http://neuro.debian.net" target="_blank">http://neuro.debian.net</a> <a href="http://www.pymvpa.org" target="_blank">http://www.pymvpa.org</a> <a href="http://www.fail2ban.org" target="_blank">http://www.fail2ban.org</a><br>
Research Scientist,            Psychological and Brain Sciences Dept.<br>
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755<br>
Phone: <a href="tel:%2B1%20%28603%29%20646-9834" value="+16036469834">+1 (603) 646-9834</a>                       Fax: <a href="tel:%2B1%20%28603%29%20646-1419" value="+16036461419">+1 (603) 646-1419</a><br>
WWW:   <a href="http://www.linkedin.com/in/yarik" target="_blank">http://www.linkedin.com/in/yarik</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
</div></div></blockquote></div></div>