This documentation is for scikit-learn version 0.11-gitOther versions

Citing

If you use the software, please consider citing scikit-learn.

This page

8.10.2. sklearn.grid_search.IterGrid

class sklearn.grid_search.IterGrid(param_grid)

Generators on the combination of the various parameter lists given

Parameters :

param_grid: dict of string to sequence :

The parameter grid to explore, as a dictionary mapping estimator parameters to sequences of allowed values.

Returns :

params: dict of string to any :

Yields dictionaries mapping each estimator parameter to one of its allowed values.

Examples

>>> from sklearn.grid_search import IterGrid
>>> param_grid = {'a':[1, 2], 'b':[True, False]}
>>> list(IterGrid(param_grid)) 
[{'a': 1, 'b': True}, {'a': 1, 'b': False},
 {'a': 2, 'b': True}, {'a': 2, 'b': False}]
__init__(param_grid)