diff --git a/bangmetric/dprime.py b/bangmetric/dprime.py index 3e5ac94..32d4799 100644 --- a/bangmetric/dprime.py +++ b/bangmetric/dprime.py @@ -13,7 +13,6 @@ DEFAULT_FUDGE_FACTOR = 0.5 DEFAULT_FUDGE_MODE = 'correction' -ATOL = 1e-6 def dprime(y_pred, y_true, **kwargs): @@ -132,7 +131,7 @@ def dprime_from_samp(pos, neg, maxv=None, minv=None, safedp=True, bypass_nchk=Fa def dprime_from_confusion_ova(M, fudge_mode=DEFAULT_FUDGE_MODE, \ - fudge_fac=DEFAULT_FUDGE_FACTOR, atol=ATOL): + fudge_fac=DEFAULT_FUDGE_FACTOR): """Computes the one-vs-all d-prime sensitivity index of the confusion matrix. Parameters @@ -150,9 +149,6 @@ def dprime_from_confusion_ova(M, fudge_mode=DEFAULT_FUDGE_MODE, \ 'always': always apply the fudge factor 'correction': apply only when needed - atol: float, optional - Tolerance to simplify the dp from a 2-way (i.e., 2x2) confusion matrix. - Returns ------- dp: array, shape = [n_classes] @@ -162,8 +158,6 @@ def dprime_from_confusion_ova(M, fudge_mode=DEFAULT_FUDGE_MODE, \ ---------- http://en.wikipedia.org/wiki/D' http://en.wikipedia.org/wiki/Confusion_matrix - - XXX: no normalization for unbalanced data """ M = np.array(M) @@ -197,7 +191,7 @@ def dprime_from_confusion_ova(M, fudge_mode=DEFAULT_FUDGE_MODE, \ dp = norm.ppf(TPR) - norm.ppf(FPR) # if there's only two dp's then, it's must be "A" vs. "~A" task. If so, just give one value - if len(dp) == 2 and np.abs(dp[0] - dp[1]) < atol: + if len(dp) == 2: dp = np.array([dp[0]]) return dp