How to calculate AUC of ROC curve from these data ?

15 次查看(过去 30 天)
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 个评论
Victor Daniel Reyes Dreke
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

请先登录,再进行评论。

回答(1 个)

Sharmili S
Sharmili S 2023-1-27
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

类别

Help CenterFile Exchange 中查找有关 ROC - AUC 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by