Confusion matrix neural network

2 views (last 30 days)
John
John on 6 May 2013
Commented: Vikas on 10 Mar 2016
Hello,
The confusion matrix for my NN for classification is below. I'm struggling to understand the numbers. I know the overall correctly classified data is 81.5%.
I would be grateful if somebody had the time to answer a couple of questions.
If I take the 1st row as an example.
What does 22.2% represent?
What does 4 and 14.8% represent?
What does 60.0% (in green) represent?
What does the bottom grey row represent for example 85.7%?
Thanks for your help

Accepted Answer

Greg Heath
Greg Heath on 7 May 2013
Look at column one for class 1 targets
There were 7 class 1 targets
6 were assigned correctly(GREEN) to output class 1
1 was assigned incorrectly (RED) to output class 2
0 were assigned to output class 3 (Ignore colors for 0 entries)
100*6/7 = 85.7% (GREEN)of class 1 targets were correctly assigned
100*1/7 = 14.3% (RED) of class 1 targets were incorrectly assigned
Look at row two for targets assigned to class 2
17 targets were assigned to output class 2
1 target from class 1 was incorrectly(RED) assigned to class 2
16 targets from class 2 were correctly(GREEN) assigned to class2
100*16/17 = 94.1%(GREEN) of assignments to class 2 were correct
100*1/17 = 5.9%(RED) of assignments to class 2 were incorrect
Look at interior square percentages
There were 6+1+16+4 = 27 targets
100*6/27 = 22.2%
100*1/27 = 3.7%
100*16/27 = 59.3%
100*4/27 = 14.8%
If it makes you feel any better, I do not like the format (e.g., I used to use the rows for target classes). However, using the column target format, I use a count confusion matrix and a percent confusion matrix:
6 0 4 10
1 16 0 17
7 16 4 27
and
85.7 0 100 37
14.3 100 0 63
100 100 100 100
Hope this helps.
Thank you for formally accepting my answer
Greg

More Answers (1)

D C
D C on 21 Oct 2013
Edited: D C on 21 Oct 2013
Is there any way to display this values in workspace? I got 10 classes and I cannot read them from the diagram because they overlap.
  1 Comment
Vikas
Vikas on 10 Mar 2016
[c,cm,ind,per] = confusion(targets,outputs)

Sign in to comment.

Categories

Find more on Sequence and Numeric Feature Data Workflows 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!