MATLAB Answers


I want to plot the Roc curve using perfcurve function i have 2 plot which code is right

Asked by As Has on 27 Jul 2018
Latest activity Commented on by KALYAN ACHARJYA on 30 Jul 2018
the code is [Xpr,Ypr,Tpr,AUCpr] = perfcurve(targets,abs(scores(:,1)), 1, 'xCrit', 'reca', 'yCrit', 'fpr');
xlabel('specificity'); ylabel('sensitivity') title(['ROC curve (AUC: ' num2str(AUCpr) ')'])
where scores(2 columns ) the first for predict abnormal image and the second for normal the problem is i got this graph
and if i change the score into abs(scores(:,2)), 1,i get an extremely different graph


Sign in to comment.

1 Answer

Answer by KALYAN ACHARJYA on 29 Jul 2018
Edited by KALYAN ACHARJYA on 29 Jul 2018
 Accepted Answer

Let me clear that ROC curve: 1-specificity vs sensitivity (In your figure x-axis is specificity). Ant the traditional ROC curve looks like as second figure. First one is incorrect. If your curve position towards the northwest corner, it is more accurate. Better follow TOM paper , here explains everything.
Attache figure for some sample ROC curves. AUC value range from 0.5-0.99,AUC value in larger side more better the proposed method. Curve never appper below the reference line (In attached figure red line).Purple curve having better method.
Hope the answer helps you!


thanks so much what does the red line represent ? [Xpr,Ypr,Tpr,AUCpr] = perfcurve(....
Just reference line, worst condition (50% random probability ), your ROC curve on that line.

Sign in to comment.