MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / _false_negative_probability

Function _false_negative_probability

join/LSH/datasketch/lshensemble.py:19–27  ·  view source on GitHub ↗
(threshold, b, r, xq)

Source from the content-addressed store, hash-verified

17
18# 由式(24)计算FN概率
19def _false_negative_probability(threshold, b, r, xq):
20 _probability = lambda t : 1 - (1 - (1 - (t/(1 + xq - t))**float(r))**float(b))
21 if xq >= 1.0:
22 a, err = integrate(_probability, threshold, 1.0)
23 return a
24 if xq >= threshold:
25 a, err = integrate(_probability, threshold, xq)
26 return a
27 return 0.0
28
29# 为使假阳性和假阴性概率的加权和达到最小,计算最佳参数
30def _optimal_param(threshold, num_perm, max_r, xq, false_positive_weight,

Callers 1

_optimal_paramFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected