Skip to content

Commit

Permalink
Bugfix to correctly report the best label for each reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Dec 14, 2024
1 parent e8c9221 commit 8ffa919
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/singler/classify_integrated.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ def classify_integrated(
num_threads
)

by_ref = {}
for i, b in enumerate(best_ref):
if b not in by_ref:
by_ref[b] = []
by_ref[b].append(i)
best_label = [None] * test_data.shape[1]
for ref in set(best_ref):
for ref, which in by_ref.items():
curbest = results[ref].column("best")
for i, b in enumerate(curbest):
if b == ref:
best_label[i] = curbest[i]
for i in which:
best_label[i] = curbest[i]

all_refs = [str(i) for i in range(len(raw_scores))]
scores = {}
Expand Down

0 comments on commit 8ffa919

Please sign in to comment.