Azzera filtri
Azzera filtri

How to calculate AUC of ROC curve from these data ?

21 visualizzazioni (ultimi 30 giorni)
Hi everyone I have my raw data that I attach in this question.These data are output from a neural network classification and I am able to plot ROC curve from them. by the code below;
figure(1)
plotroc(targets_train,outputs_train)
title({'ROC Curve of Train Set for Neural network classification'})
xlabel('False positive rate') % x-axis label
ylabel('True positive rate') % y-axis label
figure(2)
plotroc(targets_testset,outputs_test)
title({'ROC Curve of Test Set for Neural network classification'})
xlabel('False positive rate') % x-axis label
ylabel('True positive rate') % y-axis label
However, I don't have any idea, how to calculate AUC of ROC curve from these data ?.
Anyone help me,please ?
Thanks in advance
Pradya
  1 Commento
Victor Daniel Reyes Dreke
Victor Daniel Reyes Dreke il 18 Mag 2020
Try to use the function [tpr,fpr]=roc(targets,outputs). This function outcomes are the true positive rate and false positive rate used to build the ROC Curve. Finally, trapz(fpr,tpr) will give you the area under the ROC curve

Accedi per commentare.

Risposte (1)

Sharmili S
Sharmili S il 27 Gen 2023
figure(1)
plotroc(targets_train,outputs_train)
title({'ROC Curve of Train Set for Neural network classification'})
xlabel('False positive rate') % x-axis label
ylabel('True positive rate') % y-axis label
figure(2)
plotroc(targets_testset,outputs_test)
title({'ROC Curve of Test Set for Neural network classification'})
xlabel('False positive rate') % x-axis label
ylabel('True positive rate') % y-axis label

Categorie

Scopri di più su ROC - AUC in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by