How to generate confusion matrix for multi class?

조회 수: 4 (최근 30일)
tejasvee
tejasvee 2017년 6월 15일
답변: Abhipsa 2025년 2월 17일
I have 4 classes and want to plot confusion matrix.I referred to examples but i can't understood. Anyone please help how to plot confusion matrix if i have 5 classes. and what are requirements for plotting confusion matrix.

답변 (1개)

Abhipsa
Abhipsa 2025년 2월 17일
For plotting the confusion matrix for 5 classes, you can use “confusionchart” from MATLAB Deep Learning Toolbox (https://www.mathworks.com/help/releases/R2024b/deeplearning/ref/confusionchart.html ) starting from MATLAB R2018b.
The attached file named “confusion_chart.m” demonstrates creating a confusion matrix using “confusionchart”.
Output of the attachment “confusion_chart.m”:
Since “confusionchart” is available from MATLAB R2018b, for older versions, “confusionmat” can be used instead.
The attached file named “confusion_mat.m” demonstrates creating a confusion matrix using “confusionmat”.
Output of the attachment “confusion_mat.m”:
You can use the command “>> doc confusionmat” to know more about it.
I hope this helps you!

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by