How to remove a specific class in the confusion matrix?

3 ビュー (過去 30 日間)
Mibang
Mibang 2024 年 3 月 26 日
コメント済み: Voss 2024 年 3 月 28 日
Hi,
I have a confusion matrix that can be generated by the code below with attached mat-file.
figure; cm = confusionchart([trueCellR{:}],[testCellR{:}],'RowSummary','row-normalized','ColumnSummary','column-normalized');
I want to remove the class of "n/a" in both confusion matrix and generated figure.
Besides, how can I change the order of the classes in the figure?
Thank you very much,

採用された回答

Voss
Voss 2024 年 3 月 26 日
load testCells
x = removecats([trueCellR{:}],'n/a');
y = removecats([testCellR{:}],'n/a');
x = reordercats(x,[3 2 1]);
figure; cm = confusionchart(x,y,'RowSummary','row-normalized','ColumnSummary','column-normalized');
  6 件のコメント
Mibang
Mibang 2024 年 3 月 28 日
Great, thanks again!!
Voss
Voss 2024 年 3 月 28 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by