フィルターのクリア

Confusion Matrix with known True and Predicted Values

3 ビュー (過去 30 日間)
Elizabeth Cardona
Elizabeth Cardona 2021 年 2 月 15 日
回答済み: Mahesh Taparia 2021 年 2 月 22 日
I did some machine learning with some datasets. I now have accuracies and numerical numbers of prdicted classes and true classes as shown below:
The different colors (blue, orange, grey, and yellow) show different datasets. The model is pretty accurate, but has some misclassifications. For example take a look at the first row. for the Model(blue), the dataset had 3,505 responsive cells (3392+113), 3392 were correctly identified as responsive but 113 were misclassfied as resistant, making 96.776% accuracy. I want to show either all of the Model(blue) in a confusion matrix with percentages and colors (green for correct, red for incorrect) in a confusion matrix. Or maybe even all the datasets in one matrix. But I'd like to start with one forst to see how it works.
I have tried plotconfusion(), confusionmat(), but I don't think I'm inputting the data correctly.
PLEASE HELP ME.

採用された回答

Mahesh Taparia
Mahesh Taparia 2021 年 2 月 22 日
Hi
You are already having the class-wise information about the number of correct and misclassified objects, you can use confusionchart function to visualize the confusion matrix. You can refer to this documentation for more information. In your case, a sample example is given below:
A=[3392 113 0 0;125 3397 0 0;0 0 3109 366;0 0 356 3142];
cm = confusionchart(A)
cm.RowSummary = 'row-normalized';
cm.ColumnSummary = 'column-normalized';
Hope it will help!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by