Skip to content

Commit 4eded7f

Browse files
committed
removed trailing commas - one time activity
1 parent af74bf9 commit 4eded7f

File tree

12 files changed

+15
-17
lines changed

12 files changed

+15
-17
lines changed

examples/applications/porto_seguro_keras_under_sampling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def fit_predict_balanced_model(X_train, y_train, X_test, y_test):
226226
)
227227
df_time = (
228228
pd.DataFrame(
229-
{"Balanced model": cv_time_balanced, "Imbalanced model": cv_time_imbalanced,}
229+
{"Balanced model": cv_time_balanced, "Imbalanced model": cv_time_imbalanced}
230230
)
231231
.unstack()
232232
.reset_index()

examples/plot_outlier_rejections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def plot_scatter(X, y, title):
7171
)
7272
X_test = np.vstack([moons, blobs])
7373
y_test = np.hstack(
74-
[np.ones(moons.shape[0], dtype=np.int8), np.zeros(blobs.shape[0], dtype=np.int8),]
74+
[np.ones(moons.shape[0], dtype=np.int8), np.zeros(blobs.shape[0], dtype=np.int8)]
7575
)
7676

7777
plot_scatter(X_test, y_test, "Testing dataset")

examples/under-sampling/plot_illustration_nearmiss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def make_plot_despine(ax):
4040

4141
# minority class
4242
X_minority = np.transpose(
43-
[[1.1, 1.3, 1.15, 0.8, 0.8, 0.6, 0.55], [1.0, 1.5, 1.7, 2.5, 2.0, 1.2, 0.55],]
43+
[[1.1, 1.3, 1.15, 0.8, 0.8, 0.6, 0.55], [1.0, 1.5, 1.7, 2.5, 2.0, 1.2, 0.55]]
4444
)
4545
# majority class
4646
X_majority = np.transpose(

examples/under-sampling/plot_illustration_tomek_links.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def make_plot_despine(ax):
8888
for ax, title, sampler in zip(
8989
ax_arr,
9090
title_arr,
91-
[TomekLinks(sampling_strategy="auto"), TomekLinks(sampling_strategy="all"),],
91+
[TomekLinks(sampling_strategy="auto"), TomekLinks(sampling_strategy="all")],
9292
):
9393
X_res, y_res = sampler.fit_resample(
9494
np.vstack((X_minority, X_majority)),

imblearn/metrics/_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ class is unrecognized by the classifier, G-mean resolves to zero. To
617617
else:
618618
n_labels = len(labels)
619619
labels = np.hstack(
620-
[labels, np.setdiff1d(present_labels, labels, assume_unique=True),]
620+
[labels, np.setdiff1d(present_labels, labels, assume_unique=True)]
621621
)
622622

623623
le = LabelEncoder()

imblearn/metrics/tests/test_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def test_iba_sklearn_metrics(score, expected_score):
439439

440440
@pytest.mark.parametrize(
441441
"score_loss",
442-
[average_precision_score, brier_score_loss, cohen_kappa_score, roc_auc_score,],
442+
[average_precision_score, brier_score_loss, cohen_kappa_score, roc_auc_score],
443443
)
444444
def test_iba_error_y_score_prob_error(score_loss):
445445
y_true, y_pred, _ = make_prediction(binary=True)

imblearn/over_sampling/tests/test_adasyn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_ada_fit_resample():
7979
]
8080
)
8181
y_gt = np.array(
82-
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0,]
82+
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0]
8383
)
8484
assert_allclose(X_resampled, X_gt, rtol=R_TOL)
8585
assert_array_equal(y_resampled, y_gt)
@@ -118,7 +118,7 @@ def test_ada_fit_resample_nn_obj():
118118
]
119119
)
120120
y_gt = np.array(
121-
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0,]
121+
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0]
122122
)
123123
assert_allclose(X_resampled, X_gt, rtol=R_TOL)
124124
assert_array_equal(y_resampled, y_gt)

imblearn/over_sampling/tests/test_smote.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_sample_regular():
7676
]
7777
)
7878
y_gt = np.array(
79-
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0,]
79+
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0]
8080
)
8181
assert_allclose(X_resampled, X_gt, rtol=R_TOL)
8282
assert_array_equal(y_resampled, y_gt)
@@ -149,7 +149,7 @@ def test_sample_regular_with_nn():
149149
]
150150
)
151151
y_gt = np.array(
152-
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0,]
152+
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0]
153153
)
154154
assert_allclose(X_resampled, X_gt, rtol=R_TOL)
155155
assert_array_equal(y_resampled, y_gt)

imblearn/tests/test_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ def test_pipeline_param_error():
12481248
r"\[Pipeline\].*\(step 2 of 2\) Processing clf.* total=.*\n$",
12491249
),
12501250
(
1251-
Pipeline([("transf", Transf()), ("noop", None), ("clf", FitParamT()),]),
1251+
Pipeline([("transf", Transf()), ("noop", None), ("clf", FitParamT())]),
12521252
r"\[Pipeline\].*\(step 1 of 3\) Processing transf.* total=.*\n"
12531253
r"\[Pipeline\].*\(step 2 of 3\) Processing noop.* total=.*\n"
12541254
r"\[Pipeline\].*\(step 3 of 3\) Processing clf.* total=.*\n$",

imblearn/under_sampling/_prototype_selection/tests/test_repeated_edited_nearest_neighbours.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_renn_fit_resample():
151151
]
152152
)
153153
y_gt = np.array(
154-
[0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,]
154+
[0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
155155
)
156156
assert_array_equal(X_resampled, X_gt)
157157
assert_array_equal(y_resampled, y_gt)
@@ -337,7 +337,7 @@ def test_renn_not_good_object():
337337

338338

339339
@pytest.mark.parametrize(
340-
"max_iter, n_iter", [(2, 2), (5, 3),],
340+
"max_iter, n_iter", [(2, 2), (5, 3)],
341341
)
342342
def test_renn_iter_attribute(max_iter, n_iter):
343343
renn = RepeatedEditedNearestNeighbours(max_iter=max_iter)

0 commit comments

Comments
 (0)