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

Method query

join/LSH/datasketch/lshensemble.py:227–244  ·  view source on GitHub ↗

给出查询集的MinHash和大小,检索出与查询集containment大于阈值的查询集。 Args: minhash (datasketch.MinHash): 查询集合的minhash. size (int): 查询集的大小(unique value). Returns: 满足条件候选集的键值.

(self, minhash, size)

Source from the content-addressed store, hash-verified

225 self.indexes[curr_part][r].insert(key, minhash)
226
227 def query(self, minhash, size):
228 '''
229 给出查询集的MinHash和大小,检索出与查询集containment大于阈值的查询集。
230
231 Args:
232 minhash (datasketch.MinHash): 查询集合的minhash.
233 size (int): 查询集的大小(unique value).
234
235 Returns:
236 满足条件候选集的键值.
237 '''
238 for i, index in enumerate(self.indexes):
239 u = self.uppers[i]
240 if u is None:
241 continue
242 b, r = self._get_optimal_param(u, size)
243 for key in index[r]._query_b(minhash, b):
244 yield key
245
246 # index中是否存在键值key
247 def __contains__(self, key):

Callers

nothing calls this directly

Calls 2

_get_optimal_paramMethod · 0.95
_query_bMethod · 0.80

Tested by

no test coverage detected