@@ -1024,42 +1024,6 @@ class GridSearchCV(BaseSearchCV):
10241024 .. versionchanged:: v0.20
10251025 `n_jobs` default changed from 1 to None
10261026
1027- pre_dispatch : int, or str, default=n_jobs
1028- Controls the number of jobs that get dispatched during parallel
1029- execution. Reducing this number can be useful to avoid an
1030- explosion of memory consumption when more jobs get dispatched
1031- than CPUs can process. This parameter can be:
1032-
1033- - None, in which case all the jobs are immediately
1034- created and spawned. Use this for lightweight and
1035- fast-running jobs, to avoid delays due to on-demand
1036- spawning of the jobs
1037-
1038- - An int, giving the exact number of total jobs that are
1039- spawned
1040-
1041- - A str, giving an expression as a function of n_jobs,
1042- as in '2*n_jobs'
1043-
1044- cv : int, cross-validation generator or an iterable, default=None
1045- Determines the cross-validation splitting strategy.
1046- Possible inputs for cv are:
1047-
1048- - None, to use the default 5-fold cross validation,
1049- - integer, to specify the number of folds in a `(Stratified)KFold`,
1050- - :term:`CV splitter`,
1051- - An iterable yielding (train, test) splits as arrays of indices.
1052-
1053- For integer/None inputs, if the estimator is a classifier and ``y`` is
1054- either binary or multiclass, :class:`StratifiedKFold` is used. In all
1055- other cases, :class:`KFold` is used.
1056-
1057- Refer :ref:`User Guide <cross_validation>` for the various
1058- cross-validation strategies that can be used here.
1059-
1060- .. versionchanged:: 0.22
1061- ``cv`` default value if None changed from 3-fold to 5-fold.
1062-
10631027 refit : bool, str, or callable, default=True
10641028 Refit an estimator using the best found parameters on the whole
10651029 dataset.
@@ -1090,6 +1054,25 @@ class GridSearchCV(BaseSearchCV):
10901054 .. versionchanged:: 0.20
10911055 Support for callable added.
10921056
1057+ cv : int, cross-validation generator or an iterable, default=None
1058+ Determines the cross-validation splitting strategy.
1059+ Possible inputs for cv are:
1060+
1061+ - None, to use the default 5-fold cross validation,
1062+ - integer, to specify the number of folds in a `(Stratified)KFold`,
1063+ - :term:`CV splitter`,
1064+ - An iterable yielding (train, test) splits as arrays of indices.
1065+
1066+ For integer/None inputs, if the estimator is a classifier and ``y`` is
1067+ either binary or multiclass, :class:`StratifiedKFold` is used. In all
1068+ other cases, :class:`KFold` is used.
1069+
1070+ Refer :ref:`User Guide <cross_validation>` for the various
1071+ cross-validation strategies that can be used here.
1072+
1073+ .. versionchanged:: 0.22
1074+ ``cv`` default value if None changed from 3-fold to 5-fold.
1075+
10931076 verbose : int
10941077 Controls the verbosity: the higher, the more messages.
10951078
@@ -1099,6 +1082,23 @@ class GridSearchCV(BaseSearchCV):
10991082 - >3 : the fold and candidate parameter indexes are also displayed
11001083 together with the starting time of the computation.
11011084
1085+ pre_dispatch : int, or str, default=n_jobs
1086+ Controls the number of jobs that get dispatched during parallel
1087+ execution. Reducing this number can be useful to avoid an
1088+ explosion of memory consumption when more jobs get dispatched
1089+ than CPUs can process. This parameter can be:
1090+
1091+ - None, in which case all the jobs are immediately
1092+ created and spawned. Use this for lightweight and
1093+ fast-running jobs, to avoid delays due to on-demand
1094+ spawning of the jobs
1095+
1096+ - An int, giving the exact number of total jobs that are
1097+ spawned
1098+
1099+ - A str, giving an expression as a function of n_jobs,
1100+ as in '2*n_jobs'
1101+
11021102 error_score : 'raise' or numeric, default=np.nan
11031103 Value to assign to the score if an error occurs in estimator fitting.
11041104 If set to 'raise', the error is raised. If a numeric value is given,
@@ -1366,42 +1366,6 @@ class RandomizedSearchCV(BaseSearchCV):
13661366 .. versionchanged:: v0.20
13671367 `n_jobs` default changed from 1 to None
13681368
1369- pre_dispatch : int, or str, default=None
1370- Controls the number of jobs that get dispatched during parallel
1371- execution. Reducing this number can be useful to avoid an
1372- explosion of memory consumption when more jobs get dispatched
1373- than CPUs can process. This parameter can be:
1374-
1375- - None, in which case all the jobs are immediately
1376- created and spawned. Use this for lightweight and
1377- fast-running jobs, to avoid delays due to on-demand
1378- spawning of the jobs
1379-
1380- - An int, giving the exact number of total jobs that are
1381- spawned
1382-
1383- - A str, giving an expression as a function of n_jobs,
1384- as in '2*n_jobs'
1385-
1386- cv : int, cross-validation generator or an iterable, default=None
1387- Determines the cross-validation splitting strategy.
1388- Possible inputs for cv are:
1389-
1390- - None, to use the default 5-fold cross validation,
1391- - integer, to specify the number of folds in a `(Stratified)KFold`,
1392- - :term:`CV splitter`,
1393- - An iterable yielding (train, test) splits as arrays of indices.
1394-
1395- For integer/None inputs, if the estimator is a classifier and ``y`` is
1396- either binary or multiclass, :class:`StratifiedKFold` is used. In all
1397- other cases, :class:`KFold` is used.
1398-
1399- Refer :ref:`User Guide <cross_validation>` for the various
1400- cross-validation strategies that can be used here.
1401-
1402- .. versionchanged:: 0.22
1403- ``cv`` default value if None changed from 3-fold to 5-fold.
1404-
14051369 refit : bool, str, or callable, default=True
14061370 Refit an estimator using the best found parameters on the whole
14071371 dataset.
@@ -1432,9 +1396,45 @@ class RandomizedSearchCV(BaseSearchCV):
14321396 .. versionchanged:: 0.20
14331397 Support for callable added.
14341398
1399+ cv : int, cross-validation generator or an iterable, default=None
1400+ Determines the cross-validation splitting strategy.
1401+ Possible inputs for cv are:
1402+
1403+ - None, to use the default 5-fold cross validation,
1404+ - integer, to specify the number of folds in a `(Stratified)KFold`,
1405+ - :term:`CV splitter`,
1406+ - An iterable yielding (train, test) splits as arrays of indices.
1407+
1408+ For integer/None inputs, if the estimator is a classifier and ``y`` is
1409+ either binary or multiclass, :class:`StratifiedKFold` is used. In all
1410+ other cases, :class:`KFold` is used.
1411+
1412+ Refer :ref:`User Guide <cross_validation>` for the various
1413+ cross-validation strategies that can be used here.
1414+
1415+ .. versionchanged:: 0.22
1416+ ``cv`` default value if None changed from 3-fold to 5-fold.
1417+
14351418 verbose : int
14361419 Controls the verbosity: the higher, the more messages.
14371420
1421+ pre_dispatch : int, or str, default=None
1422+ Controls the number of jobs that get dispatched during parallel
1423+ execution. Reducing this number can be useful to avoid an
1424+ explosion of memory consumption when more jobs get dispatched
1425+ than CPUs can process. This parameter can be:
1426+
1427+ - None, in which case all the jobs are immediately
1428+ created and spawned. Use this for lightweight and
1429+ fast-running jobs, to avoid delays due to on-demand
1430+ spawning of the jobs
1431+
1432+ - An int, giving the exact number of total jobs that are
1433+ spawned
1434+
1435+ - A str, giving an expression as a function of n_jobs,
1436+ as in '2*n_jobs'
1437+
14381438 random_state : int, RandomState instance or None, default=None
14391439 Pseudo random number generator state used for random uniform sampling
14401440 from lists of possible values instead of scipy.stats distributions.
0 commit comments