How to label the confusion matrix ?

27 visualizaciones (últimos 30 días)
Abhishek H P
Abhishek H P el 20 de Jun. de 2016
Editada: Katarina Vuckovic el 14 de Ag. de 2019

I have confusion matrix given expected output with 18 data values as below: [17 1 0 3 13 2 2 1 15]

I need answer to questions:

1. I want to label each axis For example: Eating, Drinking and Walking on y and x axis Implying 17/18 identified correctly as eating Implying 13/18 identified correctly as drinking Implying 15/18 identified correctly as walking

2. Also, How can I display percentage of correctness in confusion matrix eg: [ 17/18 1/18 0/18 3/18 13/18 2/18 2/18 1/18 15/18 ]

Meaning...

Confusion matrix display

         Eating Drinking Walking

Eating 94 5 0 Drinking 15 72 10 Walking 10 5 83]

I appreciate your time and consideration in advance

Respuestas (1)

Katarina Vuckovic
Katarina Vuckovic el 14 de Ag. de 2019
Editada: Katarina Vuckovic el 14 de Ag. de 2019
1. You have to use categorical() funtion to convert the string otherwise it will not work. For example:
x = [49 0 1 ;0 47 3; 1 3 46]
label = {'walking','drinking','eating'}
label = categorical(label)
cm = confusionchart(x,label)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by