Improvements

This commit is contained in:
Yomguithereal 2018-06-20 18:35:12 +02:00
parent 1402f449aa
commit e260e481cf
2 changed files with 2 additions and 4 deletions

View File

@ -11,7 +11,7 @@ from collections import defaultdict
import math
from fog.clustering.utils import merge_buckets_into_clusters
from fog.lsh.minhash import LSBMinHash, MinHash
from fog.lsh.minhash import MinHash
from fog.metrics.jaccard import jaccard_similarity

View File

@ -33,10 +33,8 @@ def crc32(x):
class MinHash(object):
def __init__(self, h=256, seed=None):
# TODO: weighted
# TODO: cheap_hashes
# TODO: lsb
# TODO: superminhash
rng = Random(seed)
@ -124,7 +122,7 @@ class SuperMinHash(object):
while j <= a:
r = rng.random()
k = rng.randint(j, m - 1)
k = j + math.floor(r * (m - j))
if q[j] != i:
q[j] = i