<div dir="ltr">Terrific. I just took a quick look but I think this is just what I need.<div><br></div><div>Thanks!</div><div><br></div><div>Cheers,</div><div>Jason</div><div><br></div><div><br></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Thu, Jan 16, 2014 at 10:21 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">

look into a classifier ca.estimates.  Some classifiers (e.g. SMLR, GNB)<br>
would base their decision on e.g. a posterior probability which would<br>
then be stored in the clf.ca.estimates for a classifier clf upon making<br>
a prediction. E.g.<br>
<br>
In [18]: clf = mv.SMLR(enable_ca=['predictions'])<br>
<br>
In [19]: clf.train(mvtd.datasets['uni3small'])<br>
<br>
In [20]: clf.predict(mvtd.datasets['uni3small'])<br>
Out[20]:<br>
array(['L0', 'L0', 'L0', 'L0', 'L0', 'L0', 'L0', 'L0', 'L0', 'L0', 'L0',<br>
       'L0', 'L1', 'L1', 'L1', 'L1', 'L1', 'L1', 'L1', 'L1', 'L1', 'L1',<br>
       'L1', 'L1', 'L2', 'L2', 'L2', 'L2', 'L2', 'L2', 'L2', 'L2', 'L2',<br>
       'L2', 'L2', 'L2'],<br>
      dtype='|S2')<br>
<br>
In [21]: print clf.ca.estimates<br>
[[  9.98840082e-01   7.72142962e-04   3.87774658e-04]<br>
 [  9.97071204e-01   2.78187822e-03   1.46917290e-04]<br>
 [  9.89887463e-01   4.86107005e-03   5.25146706e-03]<br>
 [  9.96544159e-01   1.23337390e-03   2.22246665e-03]<br>
 [  9.76508361e-01   2.31793063e-03   2.11737084e-02]<br>
 [  8.52440274e-01   4.06182039e-02   1.06941522e-01]<br>
 [  9.99943827e-01   1.12451619e-05   4.49279579e-05]<br>
<div><div class="h5"><br>
<br>
<br>
On Thu, 16 Jan 2014, Jason Ozubko wrote:<br>
<br>
>    Perhaps a very newbie question but when you call clf.predict is it<br>
>    possible to have the function return more than just a single prediction?<br>
>    As in, if I have 4 target labels, is it possible to get, for each test<br>
>    sample, the probability (or some other metric) with which the classifier<br>
>    thinks that each of those 4 target labels apply?<br>
>    So for example, if you had target types of "animal", "vegetable",<br>
>    "mineral", and "person" and you trained up a classifier, then with<br>
>    clf.predict I could submit a handful of test samples and get results like�<br>
>    ["vegetable"<br>
>    "vegetable"<br>
>    "animal"<br>
>    "person"<br>
>    "mineral"<br>
>    "mineral"]<br>
>    But is there any way to instead get a read out that says something like,<br>
>    for the first sample the classifier would have picked vegetable first,<br>
>    then animal, then person, and lastly mineral. �For the second sample<br>
>    however the classifier would have picked vegetable then person, then<br>
>    animal, then mineral? �So I could see not only what option the model<br>
>    predicts but also how close was each test sample to the other options as<br>
>    well?<br>
>    Thanks in advance<br>
>    Cheers,<br>
>    Jason<br>
<br>
</div></div>> _______________________________________________<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>
<span class="HOEnZb"><font color="#888888"><br>
<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>


Senior Research Associate,     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>
<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></font></span></blockquote></div><br></div>