@@ -31,8 +31,7 @@ class GridSearchCV(BaseSearchCV):
3131
3232 The parameters of the estimator used to apply these methods are optimized
3333 by cross-validated grid-search over a parameter grid.
34- Read more in the :ref:`User Guide <grid_search>`.
35-
34+
3635 Parameters
3736 ----------
3837 estimator : estimator object.
@@ -64,15 +63,16 @@ class GridSearchCV(BaseSearchCV):
6463 execution. Reducing this number can be useful to avoid an
6564 explosion of memory consumption when more jobs get dispatched
6665 than CPUs can process. This parameter can be:
67- - None, in which case all the jobs are immediately
68- created and spawned. Use this for lightweight and
69- fast-running jobs, to avoid delays due to on-demand
70- spawning of the jobs
71- - An int, giving the exact number of total jobs that are
72- spawned
73- - A string, giving an expression as a function of n_jobs,
74- as in '2*n_jobs'
75-
66+
67+ - None, in which case all the jobs are immediately
68+ created and spawned. Use this for lightweight and
69+ fast-running jobs, to avoid delays due to on-demand
70+ spawning of the jobs
71+ - An int, giving the exact number of total jobs that are
72+ spawned
73+ - A string, giving an expression as a function of n_jobs,
74+ as in '2*n_jobs'
75+
7676 iid : boolean, default=True
7777 If True, the data is assumed to be identically distributed across
7878 the folds, and the loss minimized is the total loss per sample,
@@ -81,15 +81,15 @@ class GridSearchCV(BaseSearchCV):
8181 cv : int, cross-validation generator or an iterable, optional
8282 Determines the cross-validation splitting strategy.
8383 Possible inputs for cv are:
84- - None, to use the default 3-fold cross validation,
85- - integer, to specify the number of folds in a `(Stratified)KFold`,
86- - An object to be used as a cross-validation generator.
87- - An iterable yielding train, test splits.
84+
85+ - None, to use the default 3-fold cross validation,
86+ - integer, to specify the number of folds in a `(Stratified)KFold`,
87+ - An object to be used as a cross-validation generator.
88+ - An iterable yielding train, test splits.
89+
8890 For integer/None inputs, if the estimator is a classifier and ``y`` is
8991 either binary or multiclass, :class:`StratifiedKFold` is used. In all
9092 other cases, :class:`KFold` is used.
91- Refer :ref:`User Guide <cross_validation>` for the various
92- cross-validation strategies that can be used here.
9393
9494 refit : boolean, default=True
9595 Refit the best estimator with the entire dataset.
@@ -145,18 +145,21 @@ class GridSearchCV(BaseSearchCV):
145145 A dict with keys as column headers and values as columns, that can be
146146 imported into a pandas ``DataFrame``.
147147 For instance the below given table
148- +------------+-----------+------------+-----------------+---+---------+
149- |param_kernel|param_gamma|param_degree|split0_test_score|...|rank_....|
150- +============+===========+============+=================+===+=========+
151- | 'poly' | -- | 2 | 0.8 |...| 2 |
152- +------------+-----------+------------+-----------------+---+---------+
153- | 'poly' | -- | 3 | 0.7 |...| 4 |
154- +------------+-----------+------------+-----------------+---+---------+
155- | 'rbf' | 0.1 | -- | 0.8 |...| 3 |
156- +------------+-----------+------------+-----------------+---+---------+
157- | 'rbf' | 0.2 | -- | 0.9 |...| 1 |
158- +------------+-----------+------------+-----------------+---+---------+
148+
149+ +------------+-----------+------------+-----------------+---+---------+
150+ |param_kernel|param_gamma|param_degree|split0_test_score|...|rank.....|
151+ +============+===========+============+=================+===+=========+
152+ | 'poly' | -- | 2 | 0.8 |...| 2 |
153+ +------------+-----------+------------+-----------------+---+---------+
154+ | 'poly' | -- | 3 | 0.7 |...| 4 |
155+ +------------+-----------+------------+-----------------+---+---------+
156+ | 'rbf' | 0.1 | -- | 0.8 |...| 3 |
157+ +------------+-----------+------------+-----------------+---+---------+
158+ | 'rbf' | 0.2 | -- | 0.9 |...| 1 |
159+ +------------+-----------+------------+-----------------+---+---------+
160+
159161 will be represented by a ``cv_results_`` dict of::
162+
160163 {
161164 'param_kernel': masked_array(data = ['poly', 'poly', 'rbf', 'rbf'],
162165 mask = [False False False False]...)
@@ -179,6 +182,7 @@ class GridSearchCV(BaseSearchCV):
179182 'std_score_time' : [0.001, 0.002, 0.003, 0.005],
180183 'params' : [{'kernel': 'poly', 'degree': 2}, ...],
181184 }
185+
182186 NOTE that the key ``'params'`` is used to store a list of parameter
183187 settings dict for all the parameter candidates.
184188 The ``mean_fit_time``, ``std_fit_time``, ``mean_score_time`` and
@@ -208,7 +212,7 @@ class GridSearchCV(BaseSearchCV):
208212
209213 n_splits_ : int
210214 The number of cross-validation splits (folds/iterations).
211-
215+
212216 Notes
213217 ------
214218 The parameters selected are those that maximize the score of the left out
0 commit comments