Skip to content

Commit

Permalink
Update metrics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
y-prudent authored Nov 28, 2024
1 parent 4abf299 commit 5397382
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion oodeel/eval/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ def bench_metrics(
for metric in metrics:
if isinstance(metric, str):
if metric == "auroc":
auroc = -np.trapezoid(1.0 - fpr, tpr)
if np.__version__ >= "2.0.0":
auroc = -np.trapezoid(1.0 - fpr, tpr)
else:
auroc = -np.trapz(1.0 - fpr, tpr)
metrics_dict["auroc"] = auroc

elif metric == "detect_acc":
Expand Down

0 comments on commit 5397382

Please sign in to comment.