Skip to content

Commit b602022

Browse files
committed
iter
1 parent 2fb7407 commit b602022

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

imblearn/over_sampling/_smote/cluster.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ def _fit_resample(self, X, y):
220220

221221
# the cluster is already considered balanced
222222
if cluster_class_mean < balance_threshold:
223-
print(cluster_class_mean)
224-
print(balance_threshold)
225223
continue
226224

227225
# not enough samples to apply SMOTE

imblearn/over_sampling/_smote/tests/test_kmeans_smote.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,16 @@ def test_sample_kmeans_custom(data, k_neighbors, kmeans_estimator):
9090

9191
def test_sample_kmeans_not_enough_clusters(data):
9292
X, y = data
93-
smote = KMeansSMOTE(
94-
random_state=42,
95-
kmeans_estimator=10,
96-
k_neighbors=2,
97-
)
93+
smote = KMeansSMOTE(cluster_balance_threshold=10, random_state=42)
9894
with pytest.raises(RuntimeError):
9995
smote.fit_resample(X, y)
10096

10197

102-
@pytest.mark.parametrize("density_exponent", ["auto", 18])
103-
@pytest.mark.parametrize("cluster_balance_threshold", ["auto", 0.2])
98+
@pytest.mark.parametrize("density_exponent", ["auto", 10])
99+
@pytest.mark.parametrize("cluster_balance_threshold", ["auto", 0.1])
104100
def test_sample_kmeans_density_estimation(density_exponent, cluster_balance_threshold):
105101
X, y = make_classification(
106-
n_samples=10_000, n_classes=2, weights=[0.1, 0.9], random_state=42
102+
n_samples=10_000, n_classes=2, weights=[0.3, 0.7], random_state=42
107103
)
108104
smote = KMeansSMOTE(
109105
random_state=0,

0 commit comments

Comments
 (0)