Skip to content

Commit

Permalink
Put upper bound back to 50
Browse files Browse the repository at this point in the history
This puts the upper bound for the randomly determined sample size
back to 50. The immediately preceding commits verified that the
bug can be fixed by a change in the lower bound, but we don't
always want to use a lower bound of 2!

It may be best to choose the sample size non-randomly, perhaps
testing multiple sample sizes per run using parametrization or
subtests. But that is more extensive than the small change needed
for bazingagin#45, and thus beyond the scope here.
  • Loading branch information
EliahKagan authored Aug 3, 2023
1 parent 41a179c commit fdfe6f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_knn_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_predict(self) -> None:
assert labels.shape == (1,)
assert similar_samples.shape == (top_k, 1)

test_set_size = random.randint(2, 2) # FIXME: Put upper bound back to 50.
test_set_size = random.randint(2, 50)
test_set = [self.sample_input for _ in range(test_set_size)]
top_k = 2
(distance, labels, similar_samples) = self.model.predict(test_set, top_k)
Expand Down

0 comments on commit fdfe6f3

Please sign in to comment.