Skip to content

Commit 5e9e941

Browse files
committed
Text of the ValueError in _check_param_grid has been changed.
Old value: Parameter ({0}) value should be a list. New value: Parameter values for parameter ({}) need to be a sequence.
1 parent f7f1b96 commit 5e9e941

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

sklearn/grid_search.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,12 @@ def _check_param_grid(param_grid):
332332

333333
check = [isinstance(v, k) for k in (list, tuple, np.ndarray)]
334334
if True not in check:
335-
raise ValueError("Parameter ({0}) value should be a list."
336-
"".format(name))
335+
raise ValueError("Parameter values for parameter ({}) need to "
336+
"be a sequence.".format(name))
337337

338338
if len(v) == 0:
339-
raise ValueError("Parameter ({0}) value should be a non-empty "
340-
"list.".format(name))
339+
raise ValueError("Parameter values for parameter ({}) need to "
340+
"be a non-empty sequence.".format(name))
341341

342342

343343
class _CVScoreTuple (namedtuple('_CVScoreTuple',

sklearn/model_selection/_search.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,12 @@ def _check_param_grid(param_grid):
333333

334334
check = [isinstance(v, k) for k in (list, tuple, np.ndarray)]
335335
if True not in check:
336-
raise ValueError("Parameter({0}) values should be a list."
337-
"".format(name))
336+
raise ValueError("Parameter values for parameter ({}) need to "
337+
"be a sequence.".format(name))
338338

339339
if len(v) == 0:
340-
raise ValueError("Parameter({0}) values should be a non-empty "
341-
"list.".format(name))
340+
raise ValueError("Parameter values for parameter ({}) need to "
341+
"be a non-empty sequence.".format(name))
342342

343343

344344
# XXX Remove in 0.20

0 commit comments

Comments
 (0)