Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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";
}
Posted
Comments
Stefan_Lang 17-Sep-14 8:09am    
Are you saying the first output does not match the second? If yes, could you give an example printout? If no, what are you seeing, and what do you expect?
MSMHMA 17-Sep-14 10:09am    
i have some training images and another testing images now i already trained and tested the som network and i have two result files one for train and one for test i need a c++ code to determine the accuracy for this network as my code has an error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900