@@ -22,9 +22,6 @@ def jaccard(u, v):
2222 x = count_xor (u , v )
2323 return x / (count_and (u , v ) + x )
2424
25- def kulczynski1 (u , v ):
26- return count_and (u , v ) / count_xor (u , v )
27-
2825def rogerstanimoto (u , v ):
2926 x = count_xor (u , v )
3027 return 2 * x / (len (u ) + x )
@@ -33,10 +30,6 @@ def russellrao(u, v):
3330 n = len (u )
3431 return (n - count_and (u , v )) / n
3532
36- def sokalmichener (u , v ):
37- x = count_xor (u , v )
38- return 2 * x / (len (u ) + x )
39-
4033def sokalsneath (u , v ):
4134 R = 2 * count_xor (u , v )
4235 return R / (count_and (u , v ) + R )
@@ -56,8 +49,7 @@ def test(n):
5649 aa = numpy .frombuffer (a .unpack (), dtype = bool )
5750 bb = numpy .frombuffer (b .unpack (), dtype = bool )
5851
59- for name in ['dice' , 'hamming' , 'jaccard' , 'kulczynski1' ,
60- 'rogerstanimoto' , 'russellrao' , 'sokalmichener' ,
52+ for name in ['dice' , 'hamming' , 'jaccard' , 'rogerstanimoto' , 'russellrao' ,
6153 'sokalsneath' , 'yule' ]:
6254
6355 f1 = eval (name ) # function defined above
@@ -74,4 +66,6 @@ def test(n):
7466
7567 assert abs (x1 - x2 ) < 1E-14
7668
77- test (2 ** 20 + 67 )
69+
70+ if __name__ == "__main__" :
71+ test (2 ** 22 + 67 )
0 commit comments