Skip to content

Commit d1d2369

Browse files
committed
simpler test
1 parent c01d3dc commit d1d2369

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/preprocessing/tests/test_discretization.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,17 @@ def test_ignored_invalid():
144144

145145

146146
@pytest.mark.parametrize('strategy', ['uniform', 'kmeans', 'quantile'])
147-
@pytest.mark.parametrize('n_bins', [2, 3])
148-
def test_same_min_max(strategy, n_bins):
147+
def test_same_min_max(strategy):
149148
warnings.simplefilter("always")
150149
X = np.array([[1, -2],
151150
[1, -1],
152151
[1, 0],
153152
[1, 1]])
154-
est = KBinsDiscretizer(strategy=strategy, n_bins=n_bins, encode='ordinal')
153+
est = KBinsDiscretizer(strategy=strategy, n_bins=3, encode='ordinal')
155154
assert_warns_message(UserWarning,
156155
"Feature 0 is constant and will be replaced "
157156
"with 0.", est.fit, X)
157+
assert est.n_bins_[0] == 1
158158
# replace the feature with zeros
159159
Xt = est.transform(X)
160160
assert_array_equal(Xt[:, 0], np.zeros(X.shape[0]))

0 commit comments

Comments
 (0)