Skip to content

Commit bd6c833

Browse files
committed
iter
1 parent 378dd9f commit bd6c833

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

imblearn/over_sampling/_smote/tests/test_kmeans_smote.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,15 @@ def test_sample_kmeans_custom(data, k_neighbors, kmeans_estimator):
8888
assert kmeans_smote.kmeans_estimator_.n_clusters == 3
8989

9090

91-
def test_sample_kmeans_not_enough_clusters():
92-
rng = np.random.RandomState(42)
93-
X = rng.randn(30, 2)
94-
y = np.array([1] * 20 + [0] * 10)
95-
96-
smote = KMeansSMOTE(random_state=42, kmeans_estimator=10, k_neighbors=2)
91+
def test_sample_kmeans_not_enough_clusters(data):
92+
X, y = data
93+
smote = KMeansSMOTE(
94+
density_exponent=2,
95+
cluster_balance_threshold=1,
96+
random_state=42,
97+
kmeans_estimator=10,
98+
k_neighbors=2,
99+
)
97100
with pytest.raises(RuntimeError):
98101
smote.fit_resample(X, y)
99102

0 commit comments

Comments
 (0)