accuracy on a matrix

shermanjj at gmail.com shermanjj at gmail.com
Tue Jun 2 14:55:05 CDT 2009


I don't think its a trick. Its simply agreeing on a definition of accuracy  
in a multiple decision framework. I mean, you could have a accuracy and  
precision value for each class. Simply label "positive" as being for that  
class and "negative" for being anything but that class. Other than that, I  
don't know how else to extend that definition to multiple classes.

On Jun 2, 2009 3:45pm, Carlo Rossi <serosole at yahoo.it> wrote:


> mmm it's actutally possible using some trick.

> Sincerely matrix C it's equal to cp.CountingMatrix (that contains the  
> confusion matrix). So basically I should work on the same matrix.

> Sincerely again, the cp.CountingMatrix is slightly different:

> http://www.mathworks.com/access/helpdesk/help/toolbox/bioinfo/index.html?/access/helpdesk/help/toolbox/bioinfo/ref/classperf.html

> it has a line at the end for Nan cases.



> I hope somebody here have experience and to let me know which is the  
> right accuracy

> Actaully I didn't understand your point of view on that..

> thanks,



> > I'm not familiar with these

> > particular functions, but I find it slightly odd that

> > you're using terms/statistics for a binary decision in a

> > multiple decision framework.

> >

> > That said, acc2 is something akin to the True Positive Rate

> > and I wouldn't expect it to be the same as acc1 unless

> > there is some definition that extends ideas like accuracy to

> > a multiple decision framework.

> >

> >

> > On Tue, Jun 2, 2009 at 2:22 PM,

> > Carlo Rossi serosole at yahoo.it>

> > wrote:

> >

> >

> >

> > Hello,

> >

> > it isn't obvious because implementing it (but with

> > Matlab in this two way:

> >

> >

> >

> > classification = knnclassify(TEST, TRAIN, GROUP, 1);

> >

> > [C, order] = confusionmat(TARGET, classification);

> >

> > cp = classperf(TARGET, Kclassification);

> >

> > acc1 =

> > (cp.Sensitivity*cp.Prevalence)cp.Specificity*(1-cp.Prevalence)

> >

> > acc2 = sum(diag( C )) / sum( C(:) )

> >

> >

> >

> > According to here I should return the same accuracy:

> >

> > http://en.wikipedia.org/wiki/Accuracy_and_precision

> >

> >

> >

> > But they are diffent! So for this reason I asked If

> > I were using the right formula. Does anyone have

> > experience with this stuff?

> >

> > I need to understand why the are different

> >

> > thanks,

> >

> >

> >

> > --- Mar 2/6/09, Jaroslav Hajek highegg at gmail.com>

> > ha scritto:

> >

> >

> >

> > > Da: Jaroslav Hajek highegg at gmail.com>

> >

> > > Oggetto: Re: accuracy on a matrix

> >

> > > A: "Carlo Rossi" serosole at yahoo.it>

> >

> > > Cc: help-octave at octave.org

> >

> > > Data: Martedì 2 giugno 2009, 07:14

> >

> > > On Tue, Jun 2, 2009 at

> > 2:40 AM, Carlo

> >

> > > Rossi serosole at yahoo.it>

> >

> > > wrote:

> >

> > > > Hello,

> >

> > > > I have a problem that is not strictly on Octave

> > but

> >

> > > maybe it can be

> >

> > > > interesting as I didn't find solution

> > anywhere.

> >

> > > > I have a matrix where each column/rows represent

> > a

> >

> > > class; I'm speaking about

> >

> > > > a confusion matrix.

> >

> > > > for example, three classes conf. matrix

> >

> > > > A = [2 1 1; 0 3 1; 0 0 4];

> >

> > > >

> >

> > > > and I read this: http://en.wikipedia.org/wiki/Accuracy_and_precision

> >

> > > > Is there any chance to use the first formula of

> >

> > > accuracy (actually with more

> >

> > > > than 2 classes I don't understand how apply

> > it)

> >

> > > without use the

> >

> > > > Prevalence,Sensitivity etc?

> >

> > > >

> >

> > > > thanks,

> >

> > > >

> >

> > >

> >

> > > It's obvious, isn't it?

> >

> > > accuracy = trace(A) / sum(A(:));

> >

> > > Diagonal elements represent correct classifications,

> > the

> >

> > > rest are

> >

> > > misclassifications.

> >

> > >

> >

> > > cheers

> >

> > >

> >

> > > --

> >

> > > RNDr. Jaroslav Hajek

> >

> > > computing expert & GNU Octave developer

> >

> > > Aeronautical Research and Test Institute (VZLU)

> >

> > > Prague, Czech Republic

> >

> > > url: www.highegg.matfyz..cz

> >

> > >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> > _______________________________________________

> >

> > Help-octave mailing list

> >

> > Help-octave at octave.org

> >

> > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

> >

> >

> >

> >









-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090602/27a5f59b/attachment-0001.html 


More information about the Help-octave mailing list