Skip to content

Commit a6a6787

Browse files
committed
test_grid_search_when_param_grid_includes_range test was refactored (parts that are not nessesary have been removed).
1 parent 06c8996 commit a6a6787

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

sklearn/model_selection/tests/test_search.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,18 +309,12 @@ def test_grid_search_when_param_grid_includes_range():
309309
clf = MockClassifier()
310310
grid_search = None
311311
if PY3_OR_LATER:
312-
grid_search = GridSearchCV(clf, {'foo_param': range(1, 4)}, verbose=3)
312+
grid_search = GridSearchCV(clf, {'foo_param': range(1, 4)})
313313
else:
314-
grid_search = GridSearchCV(clf, {'foo_param': xrange(1, 4)}, verbose=3)
315-
# make sure it selects the smallest parameter in case of ties
316-
old_stdout = sys.stdout
317-
sys.stdout = StringIO()
314+
grid_search = GridSearchCV(clf, {'foo_param': xrange(1, 4)})
318315
grid_search.fit(X, y)
319-
sys.stdout = old_stdout
320316
assert_equal(grid_search.best_estimator_.foo_param, 2)
321317

322-
assert_array_equal(grid_search.results_["param_foo_param"].data, [1, 2, 3])
323-
324318

325319
def test_grid_search_bad_param_grid():
326320
param_dict = {"C": 1.0}

0 commit comments

Comments
 (0)