File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ def testRandomSelf(self):
13
13
num_elements = 5000
14
14
max_num_elements = 2 * num_elements
15
15
16
+ recall_threshold = 0.98
17
+
16
18
# Generating sample data
17
19
print ("Generating data" )
18
20
# batch 1
@@ -119,7 +121,7 @@ def testRandomSelf(self):
119
121
labels_found , _ = hnsw_index .knn_query (data4 , k = 1 )
120
122
recall = np .mean (labels_found .reshape (- 1 ) == labels4 )
121
123
print (f"Recall for the 4 batch: { recall } " )
122
- self .assertGreater (recall , 0.98 )
124
+ self .assertGreater (recall , recall_threshold )
123
125
124
126
# Delete batch 4
125
127
print ("Deleting batch 4" )
@@ -138,6 +140,6 @@ def testRandomSelf(self):
138
140
labels_found , _ = hnsw_index_pckl .knn_query (data3 , k = 1 )
139
141
recall = np .mean (labels_found .reshape (- 1 ) == labels3 )
140
142
print (f"Recall for the 3 batch: { recall } " )
141
- self .assertGreater (recall , 0.98 )
143
+ self .assertGreater (recall , recall_threshold )
142
144
143
145
os .remove (index_path )
You can’t perform that action at this time.
0 commit comments