#NEWLINE# def eg2( ) : #NEWLINE# #INDENT# mg = WeightedMinHashGenerator ( 10 , 5 ) #NEWLINE# m1 = mg . minhash ( v1 ) #NEWLINE# m2 = mg . minhash ( v2 ) #NEWLINE# m3 = mg . minhash ( v3 ) #NEWLINE# print ( 'Estimated Jaccard m1, m2' , m1 . jaccard ( m2 ) ) #NEWLINE# print ( 'Estimated Jaccard m1, m3' , m1 . jaccard ( m3 ) ) #NEWLINE# lsh = WeightedMinHashLSH ( threshold = 0.1 , sample_size = 5 ) #NEWLINE# lsh . insert ( 'm2' , m2 ) #NEWLINE# lsh . insert ( 'm3' , m3 ) #NEWLINE# result = lsh . query ( m1 ) #NEWLINE# print ( 'Approximate neighbours with weighted Jaccard similarity > 0.1' , result )