mirror of https://github.com/Yomguithereal/fog.git
Fixing leader alg
This commit is contained in:
parent
a5ecda14f5
commit
3f99ca5747
|
@ -77,7 +77,7 @@ with Timer('sqrt indices'):
|
|||
|
||||
neighbors = defaultdict(lambda: (0, None))
|
||||
|
||||
for _ in range(5):
|
||||
for _ in range(1):
|
||||
pairs = sqrt_indexation_pairs(VECTORS)
|
||||
|
||||
for i, j in pairs:
|
||||
|
@ -92,8 +92,8 @@ with Timer('sqrt indices'):
|
|||
T = 0
|
||||
P = 0
|
||||
for i in range(len(VECTORS)):
|
||||
if GROUND_TRUTH[i][1] < 0.8:
|
||||
continue
|
||||
# if GROUND_TRUTH[i][1] < 0.8:
|
||||
# continue
|
||||
|
||||
T += 1
|
||||
|
||||
|
|
|
@ -164,6 +164,8 @@ def sqrt_indexation_pairs(vectors):
|
|||
for i, v in enumerate(vectors):
|
||||
leader = min(leaders, key=lambda x: 1.0 - sparse_cosine_similarity(v, vectors[x]))
|
||||
|
||||
yield i, leader
|
||||
|
||||
l = proximities[leader]
|
||||
|
||||
for j in l:
|
||||
|
|
Loading…
Reference in New Issue