/ Published in: MatLab
My implementation corresponding to Tom Fawcett's algorithm 3 in "roc graphs: notes and practical considerations for researchers, " 2004. Please see blog post for explanations and leave comments there.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function auc=areaundercurve(FPR,TPR); % given true positive rate and false positive rate calculates the area under the curve % true positive are on the y-axis and false positives on the x-axis % sum rectangular area between all points % example: auc=areaundercurve(FPR,TPR); x2=[x2,1]; % the trick is in inventing a last point 1,1 y2=TPR(inds); y2=[y2,1]; xdiff=[x2(1),xdiff];
URL: http://www.myoutsourcedbrain.com/2008/11/receiver-operating-characteristic-roc.html