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