<div dir="ltr"><p class="MsoNormal"><span lang="EN-US" style="font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">Thanks your method is
way better than my rudimentary way; I feel like a newbie, </span><span style="font-family:Arial,sans-serif">I will definitely do
it your way.</span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-family:Arial,sans-serif;background-image:initial;background-repeat:initial"><br></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">Just another thing
after running the analysis, how can I get the predictions for each trial?, I'm interested on the actual prediction, not if it was accurate or not</span></p></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 23, 2015 at 9:49 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 Wed, 23 Sep 2015, Raúl Hernández wrote:<br>
<br>
> Hi, I’m trying to evaluate on trial by trial basis how well a region can<br>
> predict the stimulus being presented to compare it with the participant’s<br>
> judgment of the stimulus. So I’m training the classifier with data from all the<br>
> trials on all the runs except by the one that I want to predict.<br>
<br>
<br>
> I’m getting really good classifications better than when I was predicting one<br>
> run using all the others. Supposedly it should be a little better as I’m<br>
> training with a little more data but I’m worried I’m doing something wrong.<br>
<br>
<br>
> Could anyone let me know if I’m making some sort of mistake?<br>
<br>
<br>
> I know that there should be a more efficient way to do it but I wanted<br>
> something easy, this is my code:<br>
<br>
<br>
> predictions = [] #this is a vector that will contain the predictions of the<br>
> classifier<br>
<br>
> for i,dsTest in enumerate(ds): #go through all the trials on ds and separate<br>
> one to test<br>
<br>
>     clf = LinearCSVMC()<br>
<br>
>     fclf = FeatureSelectionClassifier(clf, fsel)<br>
<br>
>     dsTrain = []<br>
<br>
>     dsTrain.append(ds[0:i]) #separates the training data<br>
<br>
>     dsTrain.append(ds[i:-1])<br>
<br>
</span>minor but note that :-1 would select all but last<br>
<br>
$> python -c 'print range(2)[:-1]'<br>
[0]<br>
<br>
you didn't have to do manual splitting but could've simply assigned some attribute like<br>
<br>
<a href="http://ds.sa" rel="noreferrer" target="_blank">ds.sa</a>['trials'] = np.arange(len(ds))<br>
<br>
and made use of NFoldPartitioner(attr='trials') and then CrossValidation... all standard stuff<br>
<br>
back to more optimistic results, as Jo pointed out, to carry out most<br>
trustworthy analysis you should have trained/cross-validated across runs.<br>
Also ds.summary() output last tables could provide  you some related<br>
information on trial orders ... which could also contribute to "optimistic"<br>
result (depending on the output of cause.. ;) )<br>
<span class="HOEnZb"><font color="#888888">--<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: +1 (603) 646-9834                       Fax: +1 (603) 646-1419<br>
WWW:   <a href="http://www.linkedin.com/in/yarik" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a></div></div></blockquote></div><br></div>