can anybody tell me how to generate confusion matrix in support vector machine?
1 view (last 30 days)
Show older comments
can anybody tell me how to generate confusion matrix in support vector machine? If somebody want explanation about confusion matrix then it is actually matrix which contain percent values of classification of correct classes and miscalculated classes.Like suppose I have 10 class classification and i give some input so that test values will be checked and some value will be predicted like actually and correct value in one class and wrongly predicted value in some other classes.like 80% comes in one class and rest 10 percent class 2 ,5%class 3 and 5% in class 4....like this.I want to show it in matrix form?Anybody know this how to do?
0 Comments
Accepted Answer
the cyclist
on 23 Feb 2013
There is a confusionmat() command.
2 Comments
the cyclist
on 23 Feb 2013
Edited: the cyclist
on 24 Feb 2013
Well, the on-diagonal elements are the counts of the correctly classified objects, so you just need the sum of those counts divided by the total count. If C is your confusion matrix, then I believe
>> sum(diag(C))/sum(C(:))
is the fraction of correctly classified objects.
Sound right?
You can do similar division of counts by totals to get any of the percentages you want.
More Answers (0)
See Also
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!