faster perfcurve (just in case you use FPR and TPR)

版本 1.0.0.0 (14.2 KB) 作者: Hanan Shteingart
Did you notice perfcurve is slow? This version of perfcurve is faster
637.0 次下载
更新时间 2013/6/10

查看许可证

This version is identical to the one provided by matlab with a small change if "FPR" or "TPR" are used for X and Y.
Instead of using the tedious "arrayfun" I used vector cumsum functions.

Here is a test for comparison
N = 1e5;
score = [rand(N,1); rand(N,1)-1];
label = [ones(N,1); zeros(N,1)];

tic;
perfcurve(label, score, 1);
toc
tic;
perfcurve2(label, score,1);
toc

Elapsed time is 17.614076 seconds.
Elapsed time is 0.164707 seconds.

I hope you will find it useful.

引用格式

Hanan Shteingart (2024). faster perfcurve (just in case you use FPR and TPR) (https://www.mathworks.com/matlabcentral/fileexchange/42154-faster-perfcurve-just-in-case-you-use-fpr-and-tpr), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 ROC - AUC 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0