Dear PyMVPA experts,<br><div class="gmail_quote"><br>Isn't a leave-one-out cross-validation supposed to produce a smaller bias yet a larger variance in comparison to N-fold cross-validations when N<# of samples?<br>
<br>I ran a sanity check on binary classification of 200 random samples. 4-fold cross-validations produced unbiased estimates (~50% correct), whereas leave-one-out cross-validations consistently produced below-than-chance classification performances (~40% correct). Why? <br>

<br>Any insight on this will be highly appreciated!<br><br>My code is listed below:<br><br>from mvpa2.suite import *<br>clf = LinearCSVMC();<br>cv_chunks = CrossValidation(clf, NFoldPartitioner(attr='chunks'))<br>

cv_events = CrossValidation(clf, NFoldPartitioner(attr='events'))<br>acc_chunks=[]<br>acc_events=[]<br>for i in range(200):<br> print i<br> ds=Dataset(np.random.rand(200)) <br> <a href="http://ds.sa" target="_blank">ds.sa</a>['targets']=np.remainder(range(200),2) <br>

 <a href="http://ds.sa" target="_blank">ds.sa</a>['events']=range(200)<br> <a href="http://ds.sa" target="_blank">ds.sa</a>['chunks']=np.concatenate((np.ones(50),np.ones(50)*2,np.ones(50)*3,np.ones(50)*4))<br>
 ds_chunks=cv_chunks(ds)<br>
 acc_chunks.append(1-np.mean(ds_chunks))<br> ds_events=cv_events(ds)<br> acc_events.append(1-np.mean(ds_events))<br><br>>>>print np.mean(acc_chunks), np.std(acc_chunks)<br>0.50025 0.0442542370853<br>>>>print np.mean(acc_events), np.std(acc_events)<br>

0.40674 0.189247516232<br><br>Thanks!<br>Dale<br>
</div>