@@ -1317,11 +1317,12 @@ def test_same_radius_neighbors_parallel(algorithm):
1317
1317
assert_array_equal (ind [i ], ind_parallel [i ])
1318
1318
assert_array_almost_equal (graph , graph_parallel )
1319
1319
1320
+
1320
1321
@pytest .mark .parametrize ('backend' , ['loky' , 'multiprocessing' , 'threading' ])
1321
1322
@pytest .mark .parametrize ('algorithm' , ALGORITHMS )
1322
1323
def test_knn_forcing_backend (backend , algorithm ):
1323
- # Non-regression test which ensure the knn is properly working
1324
- # even when forcing the global joblib backend
1324
+ # Non-regression test which ensure the knn methods are properly working
1325
+ # even when forcing the global joblib backend.
1325
1326
with parallel_backend (backend ):
1326
1327
X , y = datasets .make_classification (n_samples = 30 , n_features = 5 ,
1327
1328
n_redundant = 0 , random_state = 0 )
@@ -1331,9 +1332,9 @@ def test_knn_forcing_backend(backend, algorithm):
1331
1332
algorithm = algorithm ,
1332
1333
n_jobs = 3 )
1333
1334
clf .fit (X_train , y_train )
1334
- y = clf .predict (X_test )
1335
- dist , ind = clf .kneighbors (X_test )
1336
- graph = clf .kneighbors_graph (X_test , mode = 'distance' ).toarray ()
1335
+ clf .predict (X_test )
1336
+ clf .kneighbors (X_test )
1337
+ clf .kneighbors_graph (X_test , mode = 'distance' ).toarray ()
1337
1338
1338
1339
1339
1340
def test_dtype_convert ():
0 commit comments