self organizing map accuracy
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";
}
your code snippet is lacking any context
Ok, do you have a better code for this function
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.]
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