8000 Speeding up test_voting/test_gridsearch (#21422) · scikit-learn/scikit-learn@ec1248a · GitHub
[go: up one dir, main page]

Skip to content

Commit ec1248a

Browse files
authored
Speeding up test_voting/test_gridsearch (#21422)
1 parent d9e24f4 commit ec1248a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/ensemble/tests/test_voting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def test_multilabel():
263263
def test_gridsearch():
264264
"""Check GridSearch support."""
265265
clf1 = LogisticRegression(random_state=1)
266-
clf2 = RandomForestClassifier(random_state=1)
266+
clf2 = RandomForestClassifier(random_state=1, n_estimators=3)
267267
clf3 = GaussianNB()
268268
eclf = VotingClassifier(
269269
estimators=[("lr", clf1), ("rf", clf2), ("gnb", clf3)], voting="soft"
@@ -275,7 +275,7 @@ def test_gridsearch():
275275
"weights": [[0.5, 0.5, 0.5], [1.0, 0.5, 0.5]],
276276
}
277277

278-
grid = GridSearchCV(estimator=eclf, param_grid=params)
278+
grid = GridSearchCV(estimator=eclf, param_grid=params, cv=2)
279279
grid.fit(iris.data, iris.target)
280280

281281

0 commit comments

Comments
 ( 30AA 0)
0