File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -326,17 +326,18 @@ def _check_param_grid(param_grid):
326
326
param_grid = [param_grid ]
327
327
328
328
for p in param_grid :
329
- for v in p .values ():
329
+ for name , v in p .items ():
330
330
if isinstance (v , np .ndarray ) and v .ndim > 1 :
331
331
raise ValueError ("Parameter array should be one-dimensional." )
332
332
333
333
check = [isinstance (v , k ) for k in (list , tuple , np .ndarray )]
334
334
if True not in check :
335
- raise ValueError ("Parameter values should be a list." )
335
+ raise ValueError ("Parameter({0}) values should be a list."
336
+ "" .format (name ))
336
337
337
338
if len (v ) == 0 :
338
- raise ValueError ("Parameter values should be a non-empty "
339
- "list." )
339
+ raise ValueError ("Parameter({0}) values should be a non-empty "
340
+ "list." . format ( name ) )
340
341
341
342
342
343
class _CVScoreTuple (namedtuple ('_CVScoreTuple' ,
Original file line number Diff line number Diff line change @@ -327,17 +327,18 @@ def _check_param_grid(param_grid):
327
327
param_grid = [param_grid ]
328
328
329
329
for p in param_grid :
330
- for v in p .values ():
330
+ for name , v in p .items ():
331
331
if isinstance (v , np .ndarray ) and v .ndim > 1 :
332
332
raise ValueError ("Parameter array should be one-dimensional." )
333
333
334
334
check = [isinstance (v , k ) for k in (list , tuple , np .ndarray )]
335
335
if True not in check :
336
- raise ValueError ("Parameter values should be a list." )
336
+ raise ValueError ("Parameter({0}) values should be a list."
337
+ "" .format (name ))
337
338
338
339
if len (v ) == 0 :
339
- raise ValueError ("Parameter values should be a non-empty "
340
- "list." )
340
+ raise ValueError ("Parameter({0}) values should be a non-empty "
341
+ "list." . format ( name ) )
341
342
342
343
343
344
# XXX Remove in 0.20
You can’t perform that action at this time.
0 commit comments