![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192743/image.png)
I want to plot the Roc curve using perfcurve function i have 2 plot which code is right
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Salma Hassan
el 27 de Jul. de 2018
Comentada: KALYAN ACHARJYA
el 30 de Jul. de 2018
the code is [Xpr,Ypr,Tpr,AUCpr] = perfcurve(targets,abs(scores(:,1)), 1, 'xCrit', 'reca', 'yCrit', 'fpr');
plot(Xpr,Ypr)
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192720/image.png)
and if i change the score into abs(scores(:,2)), 1,i get an extremely different graph
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192721/image.png)
0 comentarios
Respuesta aceptada
KALYAN ACHARJYA
el 29 de Jul. de 2018
Editada: KALYAN ACHARJYA
el 29 de Jul. de 2018
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192743/image.png)
Hope the answer helps you!
Cheers!
2 comentarios
KALYAN ACHARJYA
el 30 de Jul. de 2018
Just reference line, worst condition (50% random probability ), your ROC curve on that line.
Más respuestas (0)
Ver también
Categorías
Más información sobre ROC - AUC en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!