Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52138e2

Browse files
authored
MAINT make ClassifierChain test more efficient (#28705)
1 parent 1bbb228 commit 52138e2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

sklearn/tests/test_multioutput.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,9 @@ def test_classifier_chain_tuple_order(order_type):
766766
y = [[3, 2], [2, 3], [3, 2]]
767767
order = order_type([1, 0])
768768

769-
chain = ClassifierChain(RandomForestClassifier(), order=order)
769+
chain = ClassifierChain(
770+
RandomForestClassifier(n_estimators=2, random_state=0), order=order
771+
)
770772

771773
chain.fit(X, y)
772774
X_test = [[1.5, 2.5, 3.5]]

sklearn/utils/estimator_checks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4003,8 +4003,8 @@ def check_n_features_in_after_fitting(name, estimator_orig):
40034003
if "warm_start" in estimator.get_params():
40044004
estimator.set_params(warm_start=False)
40054005

4006-
n_samples = 150
4007-
X = rng.normal(size=(n_samples, 8))
4006+
n_samples = 10
4007+
X = rng.normal(size=(n_samples, 4))
40084008
X = _enforce_estimator_tags_X(estimator, X)
40094009

40104010
if is_regressor(estimator):

0 commit comments

Comments
 (0)