문제

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