### lint

parent dfd1ea75
Pipeline #8620 passed with stages
in 7 minutes and 43 seconds
 ... @@ -66,12 +66,13 @@ def min_cllr(negatives, positives): ... @@ -66,12 +66,13 @@ def min_cllr(negatives, positives): pos = sorted(positives) pos = sorted(positives) N = len(neg) N = len(neg) P = len(pos) P = len(pos) I = N+P I = N + P # now, iterate through both score sets and add a 0 for negative and 1 for positive scores # now, iterate through both score sets and add a 0 for negative and 1 for n, p = 0,0 # positive scores n, p = 0, 0 ideal = numpy.zeros(I) ideal = numpy.zeros(I) neg_indices = [0]*N neg_indices = [0] * N pos_indices = [0]*P pos_indices = [0] * P for i in range(I): for i in range(I): if p < P and (n == N or neg[n] > pos[p]): if p < P and (n == N or neg[n] > pos[p]): pos_indices[p] = i pos_indices[p] = i ... @@ -88,12 +89,12 @@ def min_cllr(negatives, positives): ... @@ -88,12 +89,12 @@ def min_cllr(negatives, positives): # disable runtime warnings for a short time since log(0) will raise a warning # disable runtime warnings for a short time since log(0) will raise a warning old_warn_setup = numpy.seterr(divide='ignore') old_warn_setup = numpy.seterr(divide='ignore') # ... compute logs # ... compute logs posterior_log_odds = numpy.log(popt)-numpy.log(1.-popt); posterior_log_odds = numpy.log(popt) - numpy.log(1. - popt) log_prior_odds = math.log(float(P)/float(N)); log_prior_odds = math.log(float(P) / float(N)) # ... activate old warnings # ... activate old warnings numpy.seterr(**old_warn_setup) numpy.seterr(**old_warn_setup) llrs = posterior_log_odds - log_prior_odds; llrs = posterior_log_odds - log_prior_odds # some weired addition # some weired addition # for i in range(I): # for i in range(I): ... ...
This diff is collapsed.
This diff is collapsed.