Skip to content

Commit 23dc2b7

Browse files
committed
FIX fix n_jobs to 1 for RENN and AllKNN
1 parent 1ea07b2 commit 23dc2b7

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

imblearn/combine/tests/test_smote_enn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_validate_estimator_default():
9191

9292

9393
def test_validate_estimator_deprecation():
94-
smt = SMOTEENN(random_state=RND_SEED, n_jobs=-1)
94+
smt = SMOTEENN(random_state=RND_SEED)
9595
X_resampled, y_resampled = smt.fit_sample(X, Y)
9696
X_gt = np.array([[1.52091956, -0.49283504],
9797
[0.84976473, -0.15570176],

imblearn/combine/tests/test_smote_tomek.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def test_validate_estimator_default():
125125

126126

127127
def test_validate_estimator_deprecation():
128-
smt = SMOTETomek(random_state=RND_SEED, n_jobs=-1)
128+
smt = SMOTETomek(random_state=RND_SEED)
129129
X_resampled, y_resampled = smt.fit_sample(X, Y)
130130
X_gt = np.array([[0.68481731, 0.51935141],
131131
[1.34192108, -0.13367336],

imblearn/under_sampling/prototype_selection/edited_nearest_neighbours.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class RepeatedEditedNearestNeighbours(BaseCleaningSampler):
286286
- If ``'mode'``, the majority vote of the neighbours will be used in
287287
order to exclude a sample.
288288
289-
n_jobs : int, optional (default=-1)
289+
n_jobs : int, optional (default=1)
290290
The number of thread to open when it is possible.
291291
292292
Notes
@@ -337,7 +337,7 @@ def __init__(self,
337337
n_neighbors=3,
338338
max_iter=100,
339339
kind_sel='all',
340-
n_jobs=-1):
340+
n_jobs=1):
341341
super(RepeatedEditedNearestNeighbours, self).__init__(
342342
ratio=ratio, random_state=random_state)
343343
self.return_indices = return_indices
@@ -512,7 +512,7 @@ class without early stopping.
512512
513513
.. versionadded:: 0.3
514514
515-
n_jobs : int, optional (default=-1)
515+
n_jobs : int, optional (default=1)
516516
The number of thread to open when it is possible.
517517
518518
Notes
@@ -562,7 +562,7 @@ def __init__(self,
562562
n_neighbors=3,
563563
kind_sel='all',
564564
allow_minority=False,
565-
n_jobs=-1):
565+
n_jobs=1):
566566
super(AllKNN, self).__init__(ratio=ratio, random_state=random_state)
567567
self.return_indices = return_indices
568568
self.size_ngh = size_ngh

imblearn/under_sampling/prototype_selection/tests/test_repeated_edited_nearest_neighbours.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_renn_init():
4545

4646
assert_equal(renn.n_neighbors, 3)
4747
assert_equal(renn.kind_sel, 'all')
48-
assert_equal(renn.n_jobs, -1)
48+
assert_equal(renn.n_jobs, 1)
4949
assert_equal(renn.random_state, RND_SEED)
5050

5151

0 commit comments

Comments
 (0)