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

Antworten (3)

Gledson Melotti
Gledson Melotti am 4 Okt. 2018

1 Stimme

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 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Salma Hassan
Salma Hassan am 20 Feb. 2018

0 Stimmen

sir did you find the solution i have the same problem

8 Kommentare

Gledson Melotti
Gledson Melotti am 22 Feb. 2018
Not. If you find it, please send it to me.
Nazia Hameed
Nazia Hameed am 9 Apr. 2018
did u find any solution?
Gledson Melotti
Gledson Melotti am 10 Apr. 2018
Bearbeitet: Gledson Melotti am 10 Apr. 2018
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 am 28 Jul. 2018
Bearbeitet: Salma Hassan am 28 Jul. 2018
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 am 29 Jul. 2018
The second figure is True.
Win Sheng Liew
Win Sheng Liew am 2 Okt. 2018
Sir, may i have your code plss.
Gledson Melotti
Gledson Melotti am 4 Okt. 2018
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 am 14 Jan. 2022
Please can you help me in the section, becuase I have error thanks

Melden Sie sich an, um zu kommentieren.

Hiren Mewada
Hiren Mewada am 25 Jan. 2024

0 Stimmen

[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)

Gefragt:

am 20 Dez. 2017

Beantwortet:

am 25 Jan. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by