Вопрос

I have a confusion matrix like this:

[1   0   0   0   0 ]
[0  0.9  0  0.1  0 ]
[0   0   1   0   0 ]
[0   0   0   1   0 ]
[0.1 0  0.2  0  0.7]

where rows represent ground of truth, columns represent classification result. I would like to plot it graphically in a grid. I tried surface but it only shows a 4x4 figure whilst my matrix has 5x5 size. how can i do that?

Это было полезно?

Решение

You want your confusion values to define cell values instead of node values (as surface does).

You can use imshowfor your purpose, maybe combined with some colormap.

A = [1   0   0   0   0 
     0  0.9  0  0.1  0 
     0   0   1   0   0 
     0   0   0   1   0 
     0.1 0  0.2  0  0.7 ]


imshow(A, 'InitialMagnification',10000)  % # you want your cells to be larger than single pixels
colormap(jet) % # to change the default grayscale colormap 

enter image description here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top