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

Method index_batch

join/LSH/datasketch/lshensemble.py:155–173  ·  view source on GitHub ↗

给出一组集合的键、MinHashes和大小的索引。 Args: entries (`iterable` of `tuple`): 需要格式为 `(key, minhash, size)`, 其中key是一个集合的唯一标识符,minhash是该集合的MinHash,size是该集合的大小。 Note: size需要为正数

(self, entries)

Source from the content-addressed store, hash-verified

153 break
154
155 def index_batch(self, entries):
156 '''
157 给出一组集合的键、MinHashes和大小的索引。
158
159 Args:
160 entries (`iterable` of `tuple`): 需要格式为 `(key, minhash, size)`,
161 其中key是一个集合的唯一标识符,minhash是该集合的MinHash,size是该集合的大小。
162
163 Note:
164 size需要为正数
165 '''
166 # 将候选索引插入到对应分区
167 entries.sort(key=lambda e : e[2])
168 curr_part = 0
169 for key, minhash, size in entries:
170 if size > self.uppers[curr_part]:
171 curr_part += 1
172 for r in self.indexes[curr_part]:
173 self.indexes[curr_part][r].insert(key, minhash)
174
175 def union(self, lshE):
176 '''

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected