Display bug with confusionchart for percentages summary
3 次查看(过去 30 天)
显示 更早的评论
The "confusionchart" function seems to have a bug with the display of the summary percentage that is never displayed, as in this image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/196767/image.jpeg)
Curiously, with another code that uses the same data, the summary did not work at first, but after a while, it suddenly started to show the percentages when I ran the code.
I have tried different ways to display this (based on the Matlab documentation) and even after closing Matlab and relaunching the code, it does not change the result of the display which continues to display the summary without the percentages.
Test #1: (I also tried with only the ColumnSummary or the RowSummary, but the percentages are not displayed)
fig = figure();
[cm] = confusionchart(imdsValidation.Labels, YPred);
cm.ColumnSummary = 'column-normalized';
cm.RowSummary = 'row-normalized';
% Resize the container of the confusion chart so percentages appear in the row summary
fig_Position = fig.Position;
fig_Position(3) = fig_Position(3)*1.5; %Only change the width of the figure.
fig.Position = fig_Position;
Test #2:
fig = figure();
[cm] = confusionchart(imdsValidation.Labels, YPred,'RowSummary','row-normalized','ColumnSummary','column-normalized');
% Resize the container of the confusion chart so percentages appear in the row summary
fig_Position = fig.Position;
fig_Position(3) = fig_Position(3)*1.5; %Only change the width of the figure.
fig.Position = fig_Position;
It seems that the summary view only works sometimes. This method also works, but the display is smaller and so the numbers are very difficult to read in this case with 40 classes.
plotconfusion(imdsValidation.Labels,YPred);
I do not know if there is a solution to fix this bug, but if there is one, I would like to know. It is possible that it is due to the fact that I am on Linux Ubuntu 18.04 LTS.
0 个评论
采纳的回答
Bernhard Suhm
2018-10-11
Many machine learning related charts will start to show some weird behavior if you try to visualize a lot of classes. If you are current on support, why don't you file a case with our tech support?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!