How to creat and plot a confusion matrix of the trained CNN netowork?
古いコメントを表示
I have trained a CNN and result showed down but I would need help to find the confusion matrix of the network validation accuracy outcome 

回答 (1 件)
Mahesh Taparia
2021 年 2 月 23 日
0 投票
Hi
To find the confusion matrix, first you have to test the model on testing data and then use plotconfusion function. For more information, you can refer this example. Hope it will help!
10 件のコメント
Mohamed Elbeialy
2021 年 2 月 27 日
Mahesh Taparia
2021 年 2 月 28 日
Can you share the model prediction and the ground truth data? Or can you share your code?
Mohamed Elbeialy
2021 年 2 月 28 日
編集済み: Mohamed Elbeialy
2021 年 2 月 28 日
Mahesh Taparia
2021 年 2 月 28 日
Try this:
plotconfusion(imdsValidation.Labels,YPred)
Mohamed Elbeialy
2021 年 2 月 28 日
Mahesh Taparia
2021 年 2 月 28 日
Are you able to train the network? The trainedNet is the trained network which you have defined as:
trainedNet = trainNetwork(augimdsTrain,layers,options); % train the network
Once training completes, it will be a defined object.
Mohamed Elbeialy
2021 年 4 月 10 日
Mahesh Taparia
2021 年 4 月 12 日
You can pass the labels and predictions separately to plotConfusion function for each validation,test and training data. For example, consider below:
[YPredValidation] = classify(trainedNet,augimdsValidation); % classify the validation images
plotconfusion(imdsValidation.Labels,YPredValidation)
[YPredTraining] = classify(trainedNet,augimdsTrain); % classify the training images
plotconfusion(imdsValidation.Labels,YPredTraining)
% Similary for testing dataset
Mohamed Elbeialy
2021 年 5 月 2 日
R Ramya
2022 年 1 月 19 日
plotconfusion(YTrain,YPredicted
カテゴリ
ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!