Skip to content

Commit

Permalink
some updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gykovacs committed Nov 21, 2024
1 parent 26b5168 commit 4011709
Show file tree
Hide file tree
Showing 14 changed files with 8,707 additions and 958 deletions.
18 changes: 18 additions & 0 deletions mlscorecheck/auc/12-exponential-p-norm-illustration.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
5 changes: 4 additions & 1 deletion mlscorecheck/auc/_acc_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ def macc_min(auc, p, n):
float: the accuracy
"""
if auc >= 1 - min(p, n) / (2 * max(p, n)):
return 1 - (np.sqrt(2 * p * n - 2 * auc * p * n)) / (p + n)
tmp = 2 * p * n - 2 * auc * p * n
if np.abs(tmp) < 1e-8:
tmp = 0
return 1 - (np.sqrt(tmp)) / (p + n)

return max(p, n) / (p + n)

Expand Down
Loading

0 comments on commit 4011709

Please sign in to comment.