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

Method merge

join/LSH/datasketch/minhash.py:206–219  ·  view source on GitHub ↗

Merge the other MinHash with this one, making this one the union of both. Args: other (datasketch.MinHash): The other MinHash.

(self, other)

Source from the content-addressed store, hash-verified

204 return float(k) / np.sum(self.hashvalues / float(_max_hash)) - 1.0
205
206 def merge(self, other):
207 '''Merge the other MinHash with this one, making this one the union
208 of both.
209
210 Args:
211 other (datasketch.MinHash): The other MinHash.
212 '''
213 if other.seed != self.seed:
214 raise ValueError("Cannot merge MinHash with\
215 different seeds")
216 if len(self) != len(other):
217 raise ValueError("Cannot merge MinHash with\
218 different numbers of permutation functions")
219 self.hashvalues = np.minimum(other.hashvalues, self.hashvalues)
220
221 def digest(self):
222 '''Export the hash values, which is the internal state of the

Callers 1

createTokenIDFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected