can anybody tell me how to generate confusion matrix in support vector machine?

1 view (last 30 days)
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?

Accepted Answer

the cyclist
the cyclist on 23 Feb 2013
There is a confusionmat() command.
  2 Comments
karan dev
karan dev on 23 Feb 2013
Thank you very much.Actually can you favor me one more thing can you tell me how to see this confusion matrix in directly percentage.Again thanks for this answer
the cyclist
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.

Sign in to comment.

More Answers (0)

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!