<div dir="ltr"><div><div>Hi,<br></div>I am sorry about your bellow chance accuracy, it's always very annoying. Do you also have bellow chance accuracy with other than classifiers than GNB? So is it just speed that is your concern? you can try M1NNSearchlight, that should be also efficiently implemented, but i think the results will be very similar. Other than that, you can decrease number of folds, mask out white matter, down sample number of SL spheres or just rent an amazon cluster. Also, it seems like the BROCCOLI will have a searchlight implementation soon, so you might be able to run SVM searchlight on a GPU, but it wont be easy. You will have to time it what is fastest, but definitely try Lasso from glmnet <a href="http://www.pymvpa.org/generated/mvpa2.clfs.glmnet.GLMNET_C.html" target="_blank">http://www.pymvpa.org/generated/mvpa2.clfs.glmnet.GLMNET_C.html</a> or from sklearn.<br><br></div>In your little simulation, you will get same results with SVM too. Comparing it with binomial distribution is not fair, since binomial samples are independent, but your accuracies over CV folds are not.<br><br><br><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 22, 2016 at 8:39 PM, basile pinsard <span dir="ltr"><<a href="mailto:basile.pinsard@gmail.com" target="_blank">basile.pinsard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Hi PyMVPA community,<br><br></div>I wanted to have an advice on a problem I have using PyMVPA.<br></div>My pipeline includes a Searchlight on BOLD data, for which I used the optimized GNBSearchlight because I plan to run ~100 permutations to perform statistical testing and it is the only one offering reasonable processing time (or maybe the optimized KNN).<br><br></div><div>I have 2 classes x 8 samples for each (1 sample per chunk), the partitioner (thanks @Yaroslav) I use is: <br></div><div><div><div><div><div><div><div><div><div>prtnr_2fold_factpart = FactorialPartitioner(<br>    NFoldPartitioner(cvtype=2,attr='chunks'),<br>    attr='targets',<br>    selection_strategy='equidistant',<br>    count=32)<br></div><div>this way I repeatedly take out 2 samples of each of the 2 classes for testing and train on the remaining 2x6 samples, 'equidistant' allows all the samples to be tested approximately the same number of time, thus being equally represented in the final accuracy score.<br><br></div><div>The problem is that the distribution of accuracy in searchlight map is very wide with significantly below-chance classification, and the results are very variable across scans/subjects.<br><br></div><div>So what I did to check if there was any problem in the analysis was to replace my BOLD signal with random data from normal distribution, thus removing any potential temporal dependency (even if the design was using DeBruijn cycles for balancing carry-over effects) that could also result from GLM (GLM-LSS, Mumford 2012), detrending or else.<br></div><div><br></div><div>Results, I get some accuracy from ~10% to ~90%, far below above chance expected by normal approximation to binomial distribution (25-75%).<br></div><div>It seems that either from the design, pipeline or algorithm the information is found by chance in the random data.<br></div><div><br></div><div>I took the neighborhood of where I got these results and ran a cross-validation using the same partitioner but with GNB, LinearCSVMC, LDA.<br></div><div>GNB gives the same accuracy, so this is not the optimized GNBSearchlight that causes this<br></div><div>LinearCSVMC and LDA gives about chance (50%) accuracy for the same neighborhood.<br><br></div><div>This can be reproduced by creating a random dataset from scratch with 2 classes and randomly selecting some features:<br>ds_rand2=dataset_wizard(<br>     np.random.normal(size=(16,10000)),<br>     targets=[0,1]*8,<br>     chunks=np.arange(16))<br>cvte=CrossValidation(<br>    GNB(common_variance=True),<br>    prtnr_2fold_factpart,<br>    errorfx=mean_match_accuracy)<br></div><div>np.max([cvte(ds_rand2[:,np.random.randint(0,ds_rand2.nfeatures,size=64)]).samples.mean() for i in range(1000)])<br>0.8828125<br>np.min([cvte(ds_rand2[:,np.random.randint(0,ds_rand2.nfeatures,size=64)]).samples.mean() for i in range(1000)])<br>0.1484375<br><br></div><div>So is there something specific to GNB that gives this kind of lucky overfitting of random data when use many times as in Searchlight?<br></div><div>Also as this lucky features are included in multiple overlapping neighborhood it results in nice blobs in the searchlight which sizes depends on radius.<br></div><div>I tried the GNB with and without common_variance (thus piecewise quadratic or linear) and it is quite similar.<br></div><div>Does anybody have been using it to produce sensible results?<br></div><div>Maybe it work better with more that 2 classes.</div><div><br></div><div>LDA when applied to more features than samples is incredibly slow, thus is unrealistic for searchlight and even more with permutation testing, but I have seen it used in many papers (maybe not with permutation though), so i wonder if it is PyMVPA algorithm, or my python setup.<br>Do you think an optimized LDA searchlight 
would be possible or there is lengthy computation (eg: matrix inversion) that 
cannot be factorized?<br><br></div><div>Otherwise what kind of classifier would you recommend, that would not be too computationally intensive? Or maybe I have to deal with that?<br><br></div>Many thanks for any idea about that.<span><font color="#888888"><br><br><div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><font size="1">Basile Pinsard<br></font></div><i><font size="1">PhD candidate, <br></font></i></div><font size="1">Laboratoire d'Imagerie Biomédicale, UMR S 1146 / UMR 7371, Sorbonne Universités, UPMC, INSERM, CNRS</font><br><font size="1"><span><span style="color:rgb(51,51,51)"><span style="font-family:Arial,serif"><span lang="en-GB"><i>Brain-Cognition-Behaviour Doctoral School </i></span></span></span><span style="color:rgb(51,51,51)"><span style="font-family:Arial,serif"><span lang="en-GB"><b>, </b>ED3C<b>, </b>UPMC, Sorbonne Universités<br>Biomedical Sciences Doctoral School, Faculty of Medicine, Université de Montréal <br></span></span></span></span></font><font size="1">CRIUGM, Université de Montréal</font><br></div></div></div></div>
</div></font></span></div></div></div></div></div></div></div></div></div>
<br>_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org" target="_blank">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></blockquote></div><br></div></div>