How to calculate the ROC curve using AlexNet CNN from Matlab? I have two class.

回答 (3 件)

Gledson Melotti
Gledson Melotti 2018 年 10 月 4 日

1 投票

cgt = double(testeImagesLabels); clabel = double(Test_predict); cscores = double(Probability);
figure(2) [X,Y,T,AUC,OPTROCPT,SUBY,SUBYNAMES] = perfcurve(cgt,cscores(:,1),1); plot(X,Y,'k');

8 件のコメント

Win Sheng Liew
Win Sheng Liew 2018 年 10 月 4 日
May I know what is your testeImagesLabels,Test_predict and Probability?
Gledson Melotti
Gledson Melotti 2018 年 12 月 12 日
testeImagesLabels are my labels ground true, that is, true classes. Test_predict is my result after prediction.
Aneeba NAJEEB
Aneeba NAJEEB 2019 年 4 月 22 日
How to plot when we have 6 classes?
Gledson Melotti
Gledson Melotti 2019 年 4 月 22 日
Hi, You make one against all.
Roozbeh Kh
Roozbeh Kh 2021 年 2 月 22 日
I have 12 classes , how to make it one agaist all 12 ?
Peter
Peter 2022 年 2 月 21 日
Please see the Plot ROC Curve for Classification Tree example in the perfcurve discription for how to do this.
Jhalak Mehta
Jhalak Mehta 2022 年 4 月 12 日
編集済み: Jhalak Mehta 2022 年 4 月 12 日
How do I get the probability?
Hiren Mewada
Hiren Mewada 2024 年 1 月 25 日
classNames = net.Layers(end).Classes;
rocSmallNet = rocmetrics(imdsTest.Labels,score,classNames);
p = plot(rocSmallNet,ShowModelOperatingPoint=false)

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

Salma Hassan
Salma Hassan 2018 年 2 月 20 日

0 投票

sir did you find the solution i have the same problem

8 件のコメント

Gledson Melotti
Gledson Melotti 2018 年 2 月 22 日
Not. If you find it, please send it to me.
Nazia Hameed
Nazia Hameed 2018 年 4 月 9 日
did u find any solution?
Gledson Melotti
Gledson Melotti 2018 年 4 月 10 日
編集済み: Gledson Melotti 2018 年 4 月 10 日
Hello.
[predictedLabels,scores]=classify(myNet,testeImages);
cgt = double(testeImagesLabels);
cscores = scores;
figure(1)
[X,Y,T,AUC,OPTROCPT,SUBY,SUBYNAMES] = perfcurve(cgt,cscores(:,1),1);
plot(X,Y);
grid
xlabel('False positive rate')
ylabel('True positive rate')
title('ROC for Classification CNN')
Salma Hassan
Salma Hassan 2018 年 7 月 28 日
編集済み: Salma Hassan 2018 年 7 月 28 日
sir i change my code to yours and i got this figure
and if i change the line into score(:,2),1 i got this
which one is true
Gledson Melotti
Gledson Melotti 2018 年 7 月 29 日
The second figure is True.
Win Sheng Liew
Win Sheng Liew 2018 年 10 月 2 日
Sir, may i have your code plss.
Gledson Melotti
Gledson Melotti 2018 年 10 月 4 日
cgt = double(testeImagesLabels); clabel = double(Test_predict); cscores = double(Probability);
figure(2) [X,Y,T,AUC,OPTROCPT,SUBY,SUBYNAMES] = perfcurve(cgt,cscores(:,1),1); plot(X,Y,'k');
mustafa kanaan
mustafa kanaan 2022 年 1 月 14 日
Please can you help me in the section, becuase I have error thanks

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

Hiren Mewada
Hiren Mewada 2024 年 1 月 25 日

0 投票

[predictions,score] = classify(net, imdsTest); % To get prediction score from last layer for each class
classNames = net.Layers(end).Classes;
rocSmallNet = rocmetrics(imdsTest.Labels,score,classNames);
p = plot(rocSmallNet,ShowModelOperatingPoint=false)

質問済み:

2017 年 12 月 20 日

回答済み:

2024 年 1 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by