File Exchange

image thumbnail

Faster ROC-AUC

version 1.6 (3.43 KB) by

Fast calculation of AUC of an ROC for binary classification problems, written in C++.

18 Downloads

Updated

View License

AUC = fastAUC(labels,scores,posclass)

Calculates the Area under the ROC curve (AUC) for problems involving two distinct targets (i.e. binary classification problems). Main advantages of using this function are:

*speed
Written in C++, it performs much faster than perfcurve (Matlab statistics toolbox). On a benchmark of 20 million instances this function achieves a speed up factor of more than 100 with respect to perfcurve.

*independence
Works without needing to install the statistics toolbox.

Please send any questions, comments and/or suggestions by mail.

Comments and Ratings (5)

dymitr ruta

Its quite fast, well done, but it crashes Matlab if the labels are logical.

K G

K G (view profile)

Hello,
When I run install.m, matlab showed the following errors:

Error using mex
~\fastAUC\fastAUC.cpp: In function 'double trapezoidArea(double, double, double, double)':
~\fastAUC\fastAUC.cpp:155:32: error: call of overloaded 'abs(double)' is ambiguous
double base = std::abs(X1-X2);
^
In file included from C:\Program Files\MATLAB\R2016a/extern/include/matrix.h:23:0,
from ~\fastAUC\fastAUC.cpp:29:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:329:15: note: candidate: int abs(int)
int __cdecl abs(int _X);
^
In file included from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_algo.h:59:0,
from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/algorithm:62,
from ~\fastAUC\fastAUC.cpp:33:
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/cstdlib:166:3: note: candidate: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/cstdlib:174:3: note: candidate: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/cstdlib:179:3: note: candidate: __int128 std::abs(__int128)
abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }

Windows 8.1
MATLAB R2016a
Dev-C++ v.5.7.0

THANK YOU!!!

Ryan Smith

Works as described. Thanks!

David

David (view profile)

Updates

1.6

Bugfix (abs).

1.5

Description

1.4

Updated install file.

MATLAB Release
MATLAB 8.1 (R2013a)
Acknowledgements

Inspired: RADIOMICS

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video