Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Lemaitre committed Jul 5, 2016
1 parent 5685f15 commit 1a9a1b8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions imblearn/ensemble/balance_cascade.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def _sample(self, X, y):
# from the majority class depending of the false classification
# rate of the previous iteration
idx_sel_from_maj = random_state.choice(np.nonzero(b_sel_N)[0],
size=num_samples,
replace=False)
size=num_samples,
replace=False)
idx_sel_from_maj = np.concatenate((idx_mis_class,
idx_sel_from_maj),
axis=0).astype(int)
Expand Down
2 changes: 1 addition & 1 deletion imblearn/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, steps):
for t in transforms:
if (not (hasattr(t, "fit") or hasattr(t, "fit_transform") or
hasattr(t, "fit_sample")) or
not (hasattr(t, "transform") or hasattr(t, "sample"))):
not (hasattr(t, "transform") or hasattr(t, "sample"))):
raise TypeError("All intermediate steps of the chain should "
"be transforms and implement fit and transform"
" '%s' (type %s) doesn't)" % (t, type(t)))
Expand Down
1 change: 1 addition & 0 deletions imblearn/tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ def test_pipeline_sample_transform():

pipeline.fit(X, y).transform(X)


def test_pipeline_methods_anova_rus():
# Test the various methods of the pipeline (anova).
X, y = make_classification(n_classes=2, class_sep=2, weights=[0.1, 0.9],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def test_iht_wrong_estimator():
random_state=RND_SEED)
assert_raises(NotImplementedError, iht.fit_sample, X, Y)


def test_iht_init():
"""Test the initialisation of the object"""

Expand Down Expand Up @@ -233,7 +234,6 @@ def test_iht_fit_sample_adaboost():
assert_array_equal(y_resampled, y_gt)



def test_iht_fit_sample_gradient_boosting():
"""Test the fit sample routine with gradient boosting"""

Expand Down
1 change: 1 addition & 0 deletions imblearn/under_sampling/tests/test_nearmiss_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def test_nearmiss_wrong_version():
nm3 = NearMiss(version=version, random_state=RND_SEED)
assert_raises(ValueError, nm3.fit_sample, X, Y)


def test_nearmiss_init():
"""Test the initialisation of the object"""

Expand Down

0 comments on commit 1a9a1b8

Please sign in to comment.