Fixing leader alg

This commit is contained in:
Yomguithereal 2020-10-07 18:38:39 +02:00
parent a5ecda14f5
commit 3f99ca5747
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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: