Given binary labels y (n,) and continuous scores s (n,), return the scalar ROC AUC:
y
(n,)
scores
s
(sum_of_positive_ranks - n_pos*(n_pos+1)/2) / (n_pos*n_neg)
Input
y = [0 0 1 1] s = [0.1 0.4 0.35 0.8 ]
Output
0.75
This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.
solve(...)