@@ -989,18 +989,21 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting):
989
989
learning_rate : float, default=0.1
990
990
Learning rate shrinks the contribution of each tree by `learning_rate`.
991
991
There is a trade-off between learning_rate and n_estimators.
992
+ Values must be in the range `(0.0, inf)`.
992
993
993
994
n_estimators : int, default=100
994
995
The number of boosting stages to perform. Gradient boosting
995
996
is fairly robust to over-fitting so a large number usually
996
997
results in better performance.
998
+ Values must be in the range `[1, inf)`.
997
999
998
1000
subsample : float, default=1.0
999
1001
The fraction of samples to be used for fitting the individual base
1000
1002
learners. If smaller than 1.0 this results in Stochastic Gradient
1001
1003
Boosting. `subsample` interacts with the parameter `n_estimators`.
1002
1004
Choosing `subsample < 1.0` leads to a reduction of variance
1003
1005
and an increase in bias.
1006
+ Values must be in the range `(0.0, 1.0]`.
1004
1007
1005
1008
criterion : {'friedman_mse', 'squared_error', 'mse'}, \
1006
1009
default='friedman_mse'
@@ -1019,10 +1022,9 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting):
1019
1022
min_samples_split : int or float, default=2
1020
1023
The minimum number of samples required to split an internal node:
1021
1024
1022
- - If int, then consider `min_samples_split` as the minimum number.
1023
- - If float, then `min_samples_split` is a fraction and
1024
- `ceil(min_samples_split * n_samples)` are the minimum
1025
- number of samples for each split.
1025
+ - If int, values must be in the range `[2, inf)`.
1026
+ - If float, values must be in the range `(0.0, 1.0]` and `min_samples_split`
1027
+ will be `ceil(min_samples_split * n_samples)`.
1026
1028
1027
1029
.. versionchanged:: 0.18
1028
1030
Added float values for fractions.
@@ -1034,10 +1036,9 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting):
1034
1036
right branches. This may have the effect of smoothing the model,
1035
1037
especially in regression.
1036
1038
1037
- - If int, then consider `min_samples_leaf` as the minimum number.
1038
- - If float, then `min_samples_leaf` is a fraction and
1039
- `ceil(min_samples_leaf * n_samples)` are the minimum
1040
- number of samples for each node.
1039
+ - If int, values must be in the range `[1, inf)`.
1040
+ - If float, values must be in the range `(0.0, 1.0]` and `min_samples_leaf`
1041
+ will be `ceil(min_samples_leaf * n_samples)`.
1041
1042
1042
1043
.. versionchanged:: 0.18
1043
1044
Added float values for fractions.
@@ -1046,16 +1047,19 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting):
1046
1047
The minimum weighted fraction of the sum total of weights (of all
1047
1048
the input samples) required to be at a leaf node. Samples have
1048
1049
equal weight when sample_weight is not provided.
1050
+ Values must be in the range `[0.0, 0.5]`.
1049
1051
1050
1052
max_depth : int, default=3
1051
1053
The maximum depth of the individual regression estimators. The maximum
1052
1054
depth limits the number of nodes in the tree. Tune this parameter
1053
1055
for best performance; the best value depends on the interaction
1054
1056
of the input variables.
1057
+ Values must be in the range `[1, inf)`.
1055
1058
1056
1059
min_impurity_decrease : float, default=0.0
1057
1060
A node will be split if this split induces a decrease of the impurity
1058
1061
greater than or equal to this value.
1062
+ Values must be in the range `[0.0, inf)`.
1059
1063
1060
1064
The weighted impurity decrease equation is the following::
1061
1065
@@ -1090,10 +1094,9 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting):
1090
1094
max_features : {'auto', 'sqrt', 'log2'}, int or float, default=None
1091
1095
The number of features to consider when looking for the best split:
1092
1096
1093
- - If int, then consider `max_features` features at each split.
1094
- - If float, then `max_features` is a fraction and
1095
- `int(max_features * n_features)` features are considered at each
1096
- split.
1097
+ - If int, values must be in the range `[1, inf)`.
1098
+ - If float, values must be in the range `(0.0, 1.0]` and the features
1099
+ considered at each split will be `int(max_features * n_features)`.
1097
1100
- If 'auto', then `max_features=sqrt(n_features)`.
1098
1101
- If 'sqrt', then `max_features=sqrt(n_features)`.
1099
1102
- If 'log2', then `max_features=log2(n_features)`.
@@ -1110,11 +1113,13 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting):
1110
1113
Enable verbose output. If 1 then it prints progress and performance
1111
1114
once in a while (the more trees the lower the frequency). If greater
1112
1115
than 1 then it prints progress and performance for every tree.
1116
+ Values must be in the range `[0, inf)`.
1113
1117
1114
1118
max_leaf_nodes : int, default=None
1115
1119
Grow trees with ``max_leaf_nodes`` in best-first fashion.
1116
1120
Best nodes are defined as relative reduction in impurity.
1117
- If None then unlimited number of leaf nodes.
1121
+ Values must be in the range `[2, inf)`.
1122
+ If `None`, then unlimited number of leaf nodes.
1118
1123
1119
1124
warm_start : bool, default=False
1120
1125
When set to ``True``, reuse the solution of the previous call to fit
@@ -1123,7 +1128,7 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting):
1123
1128
1124
1129
validation_fraction : float, default=0.1
1125
1130
The proportion of training data to set aside as validation set for
1126
- early stopping. Must be between 0 and 1 .
1131
+ early stopping. Values must be in the range `(0.0, 1.0)` .
1127
1132
Only used if ``n_iter_no_change`` is set to an integer.
1128
1133
1129
1134
.. versionadded:: 0.20
@@ -1136,21 +1141,24 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting):
1136
1141
data as validation and terminate training when validation score is not
1137
1142
improving in all of the previous ``n_iter_no_change`` numbers of
1138
1143
iterations. The split is stratified.
1144
+ Values must be in the range `[1, inf)`.
1139
1145
1140
1146
.. versionadded:: 0.20
1141
1147
1142
1148
tol : float, default=1e-4
1143
1149
Tolerance for the early stopping. When the loss is not improving
1144
1150
by at least tol for ``n_iter_no_change`` iterations (if set to a
1145
1151
number), the training stops.
1152
+ Values must be in the range `(0.0, inf)`.
1146
1153
1147
1154
.. versionadded:: 0.20
1148
1155
1149
1156
ccp_alpha : non-negative float, default=0.0
1150
1157
Complexity parameter used for Minimal Cost-Complexity Pruning. The
1151
1158
subtree with the largest cost complexity that is smaller than
1152
- ``ccp_alpha`` will be chosen. By default, no pruning is performed. See
1153
- :ref:`minimal_cost_complexity_pruning` for details.
1159
+ ``ccp_alpha`` will be chosen. By default, no pruning is performed.
1160
+ Values must be in the range `[0.0, inf)`.
1161
+ See :ref:`minimal_cost_complexity_pruning` for details.
1154
1162
1155
1163
.. versionadded:: 0.22
1156
1164
@@ -1548,18 +1556,21 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting):
1548
1556
learning_rate : float, default=0.1
1549
1557
Learning rate shrinks the contribution of each tree by `learning_rate`.
1550
1558
There is a trade-off between learning_rate and n_estimators.
1559
+ Values must be in the range `(0.0, inf)`.
1551
1560
1552
1561
n_estimators : int, default=100
1553
1562
The number of boosting stages to perform. Gradient boosting
1554
1563
is fairly robust to over-fitting so a large number usually
1555
1564
results in better performance.
1565
+ Values must be in the range `[1, inf)`.
1556
1566
1557
1567
subsample : float, default=1.0
1558
1568
The fraction of samples to be used for fitting the individual base
1559
1569
learners. If smaller than 1.0 this results in Stochastic Gradient
1560
1570
Boosting. `subsample` interacts with the parameter `n_estimators`.
1561
1571
Choosing `subsample < 1.0` leads to a reduction of variance
1562
1572
and an increase in bias.
1573
+ Values must be in the range `(0.0, 1.0]`.
1563
1574
1564
1575
criterion : {'friedman_mse', 'squared_error', 'mse'}, \
1565
1576
default='friedman_mse'
@@ -1578,10 +1589,9 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting):
1578
1589
min_samples_split : int or float, default=2
1579
1590
The minimum number of samples required to split an internal node:
1580
1591
1581
- - If int, then consider `min_samples_split` as the minimum number.
1582
- - If float, then `min_samples_split` is a fraction and
1583
- `ceil(min_samples_split * n_samples)` are the minimum
1584
- number of samples for each split.
1592
+ - If int, values must be in the range `[2, inf)`.
1593
+ - If float, values must be in the range `(0.0, 1.0]` and `min_samples_split`
1594
+ will be `ceil(min_samples_split * n_samples)`.
1585
1595
1586
1596
.. versionchanged:: 0.18
1587
1597
Added float values for fractions.
@@ -1593,10 +1603,9 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting):
1593
1603
right branches. This may have the effect of smoothing the model,
1594
1604
especially in regression.
1595
1605
1596
- - If int, then consider `min_samples_leaf` as the minimum number.
1597
- - If float, then `min_samples_leaf` is a fraction and
1598
- `ceil(min_samples_leaf * n_samples)` are the minimum
1599
- number of samples for each node.
1606
+ - If int, values must be in the range `[1, inf)`.
1607
+ - If float, values must be in the range `(0.0, 1.0]` and `min_samples_leaf`
1608
+ will be `ceil(min_samples_leaf * n_samples)`.
1600
1609
1601
1610
.. versionchanged:: 0.18
1602
1611
Added float values for fractions.
@@ -1605,16 +1614,19 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting):
1605
1614
The minimum weighted fraction of the sum total of weights (of all
1606
1615
the input samples) required to be at a leaf node. Samples have
1607
1616
equal weight when sample_weight is not provided.
1617
+ Values must be in the range `[0.0, 0.5]`.
1608
1618
1609
1619
max_depth : int, default=3
1610
1620
Maximum depth of the individual regression estimators. The maximum
1611
1621
depth limits the number of nodes in the tree. Tune this parameter
1612
1622
for best performance; the best value depends on the interaction
1613
1623
of the input variables.
1624
+ Values must be in the range `[1, inf)`.
1614
1625
1615
1626
min_impurity_decrease : float, default=0.0
1616
1627
A node will be split if this split induces a decrease of the impurity
1617
1628
greater than or equal to this value.
1629
+ Values must be in the range `[0.0, inf)`.
1618
1630
1619
1631
The weighted impurity decrease equation is the following::
1620
1632
@@ -1650,10 +1662,9 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting):
1650
1662
max_features : {'auto', 'sqrt', 'log2'}, int or float, default=None
1651
1663
The number of features to consider when looking for the best split:
1652
1664
1653
- - If int, then consider `max_features` features at each split.
1654
- - If float, then `max_features` is a fraction and
1655
- `int(max_features * n_features)` features are considered at each
1656
- split.
1665
+ - If int, values must be in the range `[1, inf)`.
1666
+ - If float, values must be in the range `(0.0, 1.0]` and the features
1667
+ considered at each split will be `int(max_features * n_features)`.
1657
1668
- If "auto", then `max_features=n_features`.
1658
1669
- If "sqrt", then `max_features=sqrt(n_features)`.
1659
1670
- If "log2", then `max_features=log2(n_features)`.
@@ -1669,16 +1680,19 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting):
1669
1680
alpha : float, default=0.9
1670
1681
The alpha-quantile of the huber loss function and the quantile
1671
1682
loss function. Only if ``loss='huber'`` or ``loss='quantile'``.
1683
+ Values must be in the range `(0.0, 1.0)`.
1672
1684
1673
1685
verbose : int, default=0
1674
1686
Enable verbose output. If 1 then it prints progress and performance
1675
1687
once in a while (the more trees the lower the frequency). If greater
1676
1688
than 1 then it prints progress and performance for every tree.
1689
+ Values must be in the range `[0, inf)`.
1677
1690
1678
1691
max_leaf_nodes : int, default=None
1679
1692
Grow trees with ``max_leaf_nodes`` in best-first fashion.
1680
1693
Best nodes are defined as relative reduction in impurity.
1681
- If None then unlimited number of leaf nodes.
1694
+ Values must be in the range `[2, inf)`.
1695
+ If None, then unlimited number of leaf nodes.
1682
1696
1683
1697
warm_start : bool, default=False
1684
1698
When set to ``True``, reuse the solution of the previous call to fit
@@ -1687,7 +1701,7 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting):
1687
1701
1688
1702
validation_fraction : float, default=0.1
1689
1703
The proportion of training data to set aside as validation set for
1690
- early stopping. Must be between 0 and 1 .
1704
+ early stopping. Values must be in the range `(0.0, 1.0)` .
1691
1705
Only used if ``n_iter_no_change`` is set to an integer.
1692
1706
1693
1707
.. versionadded:: 0.20
@@ -1700,21 +1714,24 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting):
1700
1714
data as validation and terminate training when validation score is not
1701
1715
improving in all of the previous ``n_iter_no_change`` numbers of
1702
1716
iterations.
1717
+ Values must be in the range `[1, inf)`.
1703
1718
1704
1719
.. versionadded:: 0.20
1705
1720
1706
1721
tol : float, default=1e-4
1707
1722
Tolerance for the early stopping. When the loss is not improving
1708
1723
by at least tol for ``n_iter_no_change`` iterations (if set to a
1709
1724
number), the training stops.
1725
+ Values must be in the range `(0.0, inf)`.
1710
1726
1711
1727
.. versionadded:: 0.20
1712
1728
1713
1729
ccp_alpha : non-negative float, default=0.0
1714
1730
Complexity parameter used for Minimal Cost-Complexity Pruning. The
1715
1731
subtree with the largest cost complexity that is smaller than
1716
- ``ccp_alpha`` will be chosen. By default, no pruning is performed. See
1717
- :ref:`minimal_cost_complexity_pruning` for details.
1732
+ ``ccp_alpha`` will be chosen. By default, no pruning is performed.
1733
+ Values must be in the range `[0.0, inf)`.
1734
+ See :ref:`minimal_cost_complexity_pruning` for details.
1718
1735
1719
1736
.. versionadded:: 0.22
1720
1737
0 commit comments