<div dir="ltr">Thank you for the explanation. This makes sense now. It was working well within Cross-validation, but when I was calling Splitter later for a manual sensitivity analysis, for which I had found a code snippet, the analysis was using partitions 0 1 instead. So I got very different results during cross-validation, in comparison to the later sensitivity analysis. <div><br></div><div>Best,</div><div><br></div><div>Wolfgang</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 17, 2016 at 7:26 PM, Yaroslav Halchenko <span dir="ltr"><<a href="mailto:debian@onerussian.com" target="_blank">debian@onerussian.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On Tue, 17 May 2016, Wolfgang Pauli wrote:<br>
<br>
> Hi,<br>
<br>
> I think I just had a shocking revelation. I tried to do cross validation<br>
> with a custom partitioner like so:<br>
<br>
> splt_rule = [([0,1],[6,7]),([1,2],[4,7]),([2,3],[4,5]),([3,0],[5,6])]<br>
> partitioner = CustomPartitioner(splitrule=splt_rule, attr='chunks')<br>
<br>
> For example, i thought the classifier would be trained on chunks 0 and 1,<br>
> and tested on 6 and 7. during cross-validation. However, when I used<br>
> actually generated the partitions and looked which chunks are in each<br>
> partition, I found that the partitioner would actually create three<br>
> partitions, two as specified by the split rule, and one containing the<br>
> remaining chunks.<br>
<br>
> I.e. instead of getting e.g. [0,1],[6,7], I would get ([2, 3, 4,<br>
> 5],[0,1],[6,7]).<br>
<br>
> Is this correct? How can I keep it from creating that third partition with<br>
> the remaining items?<br>
<br>
</span>well, in general partitioners are implemented so they don't cause any<br>
memory impact and are fast... for that they just assign partitioning as<br>
a new sample attribute, and do not split dataset into partitions.  That<br>
job is later done by Splitter, e.g. within CrossValidation.  Within<br>
CrossValidation, that splitter cares only about partitions labeled as 1<br>
(for training) and 2 (for testing).  The others it ignores.<br>
<br>
If you really need to select those partitions 1 and 2 asap, I guess just<br>
use smth like<br>
<br>
partitioned_ds.select(partitions=[1, 2])<br>
<br>
?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Yaroslav O. Halchenko<br>
Center for Open Neuroscience     <a href="http://centerforopenneuroscience.org" rel="noreferrer" target="_blank">http://centerforopenneuroscience.org</a><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" rel="noreferrer" target="_blank">http://www.linkedin.com/in/yarik</a><br>
<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" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
</font></span></blockquote></div><br></div>