NEED HELP!!, How write a confusion matrix for 3 classes?

回答 (1 件)

yanqi liu
yanqi liu 2021 年 12 月 15 日

0 投票

yes,sir,may be use categorical to get vector to confuse,such as
clc; clear all; close all;
% for 3 classes
YTest = randi(3,[1 15]);
YPred = randi(3,[1 15]);
figure
c = confusionmat(categorical(YTest(:)), categorical(YPred(:)))
c = 3×3
4 2 3 0 0 1 1 3 1
t = confusionchart(categorical(YTest(:)), categorical(YPred(:)));

カテゴリ

質問済み:

2021 年 12 月 14 日

回答済み:

2021 年 12 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by