Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deleted elements at addition #418

Merged
merged 28 commits into from
Jan 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactoring
  • Loading branch information
dyashuni committed Sep 20, 2022
commit 812b3a40a33cf10e6a617a144028635415b21de6
6 changes: 4 additions & 2 deletions python_bindings/tests/bindings_test_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def testRandomSelf(self):
num_elements = 5000
max_num_elements = 2 * num_elements

recall_threshold = 0.98

# Generating sample data
print("Generating data")
# batch 1
Expand Down Expand Up @@ -119,7 +121,7 @@ def testRandomSelf(self):
labels_found, _ = hnsw_index.knn_query(data4, k=1)
recall = np.mean(labels_found.reshape(-1) == labels4)
print(f"Recall for the 4 batch: {recall}")
self.assertGreater(recall, 0.98)
self.assertGreater(recall, recall_threshold)

# Delete batch 4
print("Deleting batch 4")
Expand All @@ -138,6 +140,6 @@ def testRandomSelf(self):
labels_found, _ = hnsw_index_pckl.knn_query(data3, k=1)
recall = np.mean(labels_found.reshape(-1) == labels3)
print(f"Recall for the 3 batch: {recall}")
self.assertGreater(recall, 0.98)
self.assertGreater(recall, recall_threshold)

os.remove(index_path)