package sklearn

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `ParameterGrid
]
type t = [ `Object | `ParameterGrid ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : [ `Grid of (string * Dict.param_grid) list | `Grids of (string * Dict.param_grid) list list ] -> t

Grid of parameters with a discrete number of values for each.

Can be used to iterate over parameter value combinations with the Python built-in function iter.

Read more in the :ref:`User Guide <grid_search>`.

Parameters ---------- param_grid : dict of str to sequence, or sequence of such The parameter grid to explore, as a dictionary mapping estimator parameters to sequences of allowed values.

An empty dict signifies default parameters.

A sequence of dicts signifies a sequence of grids to search, and is useful to avoid exploring parameter combinations that make no sense or have no effect. See the examples below.

Examples -------- >>> from sklearn.model_selection import ParameterGrid >>> param_grid = 'a': [1, 2], 'b': [True, False] >>> list(ParameterGrid(param_grid)) == ( ... {'a': 1, 'b': True}, {'a': 1, 'b': False}, ... {'a': 2, 'b': True}, {'a': 2, 'b': False}) True

>>> grid = {'kernel': ['linear']}, {'kernel': ['rbf'], 'gamma': [1, 10]} >>> list(ParameterGrid(grid)) == {'kernel': 'linear'}, ... {'kernel': 'rbf', 'gamma': 1}, ... {'kernel': 'rbf', 'gamma': 10} True >>> ParameterGrid(grid)1 == 'kernel': 'rbf', 'gamma': 1 True

See also -------- :class:`GridSearchCV`: Uses :class:`ParameterGrid` to perform a full parallelized parameter search.

val get_item : ind:int -> [> tag ] Obj.t -> Py.Object.t

Get the parameters that would be ``ind``th in iteration

Parameters ---------- ind : int The iteration index

Returns ------- params : dict of str to any Equal to list(self)ind

val iter : [> tag ] Obj.t -> Dict.t Stdlib.Seq.t

Iterate over the points in the grid.

Returns ------- params : iterator over dict of str to any Yields dictionaries mapping each estimator parameter to one of its allowed values.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Stdlib.Format.formatter -> t -> unit

Pretty-print the object to a formatter.