|
17 | 17 | # This is required to import the functions we need to test |
18 | 18 | sys.path.append(ROOT_DIR) |
19 | 19 |
|
20 | | -# Finally import the space, vector, arithmetic operators, model, and parser utilities |
21 | | -from hdlib.space import Space, Vector |
| 20 | +from hdlib import Space, Vector |
22 | 21 | from hdlib.arithmetic import bundle, bind, permute |
23 | 22 | from hdlib.model import ClassificationModel, GraphModel |
24 | 23 |
|
@@ -182,7 +181,7 @@ def test_mlmodel(self): |
182 | 181 | # Collect the accuracy scores computed on each fold |
183 | 182 | scores = list() |
184 | 183 |
|
185 | | - for y_indices, y_pred, _, _ in predictions: |
| 184 | + for y_indices, y_pred, _, _, _ in predictions: |
186 | 185 | y_true = [label for position, label in enumerate(classes) if position in y_indices] |
187 | 186 | accuracy = accuracy_score(y_true, y_pred) |
188 | 187 |
|
@@ -233,17 +232,17 @@ def test_graph(self): |
233 | 232 | graph.fit(edges) |
234 | 233 |
|
235 | 234 | # Compute the error rate of the graph model based on its set of edge |
236 | | - error_rate, _, _ = graph.error_rate(edges) |
| 235 | + error_rate, _ = graph.error_rate() |
237 | 236 |
|
238 | 237 | if error_rate > 0.0: |
239 | 238 | # Mitigate the error rate, up to 10 iterations |
240 | | - graph.error_mitigation(edges, max_iter=10) |
| 239 | + graph.error_mitigation(max_iter=10) |
241 | 240 |
|
242 | 241 | # Define the distance threshold to establish whether an edge exists in the graph model |
243 | 242 | threshold = 0.7 |
244 | 243 |
|
245 | 244 | # Check whether the edge <2, 3> exists |
246 | | - edge_exists, dist = graph.edge_exists("2", "3", 0.2, threshold=threshold) |
| 245 | + edge_exists, _, _ = graph.edge_exists("2", "3", 0.2, threshold=threshold) |
247 | 246 |
|
248 | 247 | self.assertTrue(edge_exists) |
249 | 248 |
|
|
0 commit comments