(pos, neg)
| 47 | |
| 48 | |
| 49 | def auc(pos, neg): |
| 50 | # probability a random positive scores above a random negative |
| 51 | wins = sum((p > n) + 0.5 * (p == n) for p in pos for n in neg) |
| 52 | return wins / (len(pos) * len(neg)) |
| 53 | |
| 54 | |
| 55 | def report(name, rows, thresholds=(0.5, 0.7, 0.9)): |