Skip to content

Commit

Permalink
fix max_fpr in auroc
Browse files Browse the repository at this point in the history
  • Loading branch information
Janek Ebbers committed Apr 18, 2024
1 parent 7807502 commit d1bc478
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sed_scores_eval/base_modules/roc.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ def auroc_from_intermediate_statistics(scores_intermediate_statistics, max_fpr=N
auroc, roc_curves = {}, {}
for class_name, scores_stats in scores_intermediate_statistics.items():
auroc[class_name], roc_curves[class_name] = auroc_from_intermediate_statistics(
scores_stats,
scores_stats, max_fpr=max_fpr,
)
auroc['mean'] = np.mean([auroc[class_name] for class_name in auroc])
return auroc, roc_curves
roc_curve = roc_curve_from_intermediate_statistics(
scores_intermediate_statistics
)
tpr, fpr, *_ = roc_curve
auroc = staircase_auc(tpr, fpr, max_x=max_fpr)
norm = 1 if max_fpr is None else max_fpr
auroc = staircase_auc(tpr, fpr, max_x=max_fpr)/norm
return auroc, roc_curve

0 comments on commit d1bc478

Please sign in to comment.