8000 TST check that ensure_min_features is enforced with allow_nd=True · scikit-learn/scikit-learn@7d7b95a · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d7b95a

Browse files
committed
TST check that ensure_min_features is enforced with allow_nd=True
1 parent 1c03c8b commit 7d7b95a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sklearn/utils/tests/test_validation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ def test_check_array_min_samples_and_features_messages():
250250
assert_raise_message(ValueError, msg, check_X_y, X, y,
251251
ensure_min_features=3)
252252

253+
# Only the feature check is enabled whenever the number of dimensions is 2
254+
# even if allow_nd is enabled:
255+
assert_raise_message(ValueError, msg, check_X_y, X, y,
256+
ensure_min_features=3, allow_nd=True)
257+
253258
# Simulate a case where a pipeline stage as trimmed all the features of a
254259
# 2D dataset.
255260
X = np.empty(0).reshape(10, 0)

0 commit comments

Comments
 (0)
0