how to plot roc curve.....

15 visualizaciones (últimos 30 días)
Srinidhi Gorityala
Srinidhi Gorityala el 1 de Feb. de 2020
Comentada: Rik el 1 de Feb. de 2020
TPR = [0.86666666667 0.79333333333 0.71333333333];
FPR = [0.06666666667 0.00000000000 0.00000000000];
figure('Name','ROC','NumberTitle','off'),plot(FPR,TPR);
xlabel('FP Fraction');
ylabel('TP Fraction');
grid
Helo every one...above is the code i have been used for plotting roc curve. TPR and FPR are the values obtained at 3 thresholds respectively. The plot which i have attached is obtained from the code. The curve looks strange..could anyone help me in justifying that it is a correct plot or not for the respective parameters?

Respuesta aceptada

Rik
Rik el 1 de Feb. de 2020
Given your data, this is the ROC curve. In general the code below is added, but that is optional.
hold on, plot([0 1],[0 1],'--'), hold off
axis([0 1 0 1])
Generally, data points are added in the two corners, but that might not make sense for you.
In terms of Matlab this code is correct. It is not possible for us to tell if made a mistake somewhere else.
  3 comentarios
Srinidhi Gorityala
Srinidhi Gorityala el 1 de Feb. de 2020
Below is the curve obtained by using the above code..do we have to plot the roc curve at all threshold starting form 0 to max for a perfect curve?plotroc.jpg
Rik
Rik el 1 de Feb. de 2020
You can add the two corners without having to run any experiment:
  • For the [0 0] position: if you call all cases healthy, your FPR is 0 and your TPR is 0 as well
  • For the [1 1] position: if you call all cases diseased, you don't miss any diseased cases (TPR=1) at the cost of calling all healthy cases diseased as well (FPR=1)
Whether or not running more expirements than just the 3 you did makes sense is for you to decide, but to get the full line you can add the corners without needing to do any expirements. That is the whole point of the diagonal.

Iniciar sesión para comentar.

Más respuestas (0)

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!

Translated by