Skip to content

Commit

Permalink
fix(Evaluation): fix incorrect AUC computation - closes #165
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerdo committed Jul 27, 2022
1 parent 168c1e2 commit 976369a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aucmedi/evaluation/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ def compute_metrics(preds, labels, n_labels, threshold=None):
if threshold is None:
pred_argmax = np.argmax(preds, axis=-1)
pred = (pred_argmax == c).astype(np.int)
pred_prob = np.max(preds, axis=-1)
else:
pred = np.where(preds[:, c] >= threshold, 1, 0)
pred_prob = preds[:, c]
# Obtain prediction confidence (probability)
pred_prob = preds[:, c]

# Compute the confusion matrix
tp, tn, fp, fn = compute_CM(truth, pred)
Expand Down

0 comments on commit 976369a

Please sign in to comment.