Ask Your Question
-2

self organizing map accuracy

asked 2014-09-15 15:49:34 -0600

Hm gravatar image

i have a self organizing map c++ code which give me an accuracy for recognition system but when using this code i have a wrong accuracy by classification function anyone here can tell me where is the error with this code or give me better code for accuracy

 void  Network::classify()
{float acc;

int f=0;
for(int i=0; i<TstImgNum;i++)
{
    if((ilayer->ID[i])==label[i])
        f++;
}
 acc=((float) f / (float)TstImgNum) *100;
cout <<"\nSOM ACC="<<(((float) f / (float)TstImgNum) *100)<<"%";
cout <<"\nSOM ACC="<<acc<<"%/n";
}
edit retag flag offensive close merge delete

Comments

your code snippet is lacking any context

berak gravatar imageberak ( 2014-09-15 15:57:01 -0600 )edit

Ok, do you have a better code for this function

Hm gravatar imageHm ( 2014-09-15 16:27:19 -0600 )edit

again, probably noone can help you , unless you add some more info. (do you even call an opencv function there ? ) [atm, you're just off-topic.]

berak gravatar imageberak ( 2014-09-15 17:03:55 -0600 )edit

i'm not totally sure about this code but i need from my code to obtain accuracy by comparing the result of test images classes with the true classes for these images

Hm gravatar imageHm ( 2014-09-15 17:14:39 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-09-17 22:11:37 -0600

preheatedKD gravatar image

This isn't specific to openCV. You need to add more information for what you are trying to do. If the bug is in your code try adding break points and stepping through it for a small number of positive and negative examples.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-09-15 15:49:34 -0600

Seen: 637 times

Last updated: Sep 17 '14