diff --git a/sklearn/ensemble/forest.py b/sklearn/ensemble/forest.py index 6c3bb93e2c071..9c05fab050164 100644 --- a/sklearn/ensemble/forest.py +++ b/sklearn/ensemble/forest.py @@ -850,14 +850,16 @@ class RandomForestClassifier(ForestClassifier): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. + bootstrap : boolean, optional (default=True) Whether bootstrap samples are used when building trees. @@ -1139,14 +1141,15 @@ class RandomForestRegressor(ForestRegressor): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. bootstrap : boolean, optional (default=True) Whether bootstrap samples are used when building trees. @@ -1388,14 +1391,15 @@ class ExtraTreesClassifier(ForestClassifier): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. bootstrap : boolean, optional (default=False) Whether bootstrap samples are used when building trees. @@ -1648,14 +1652,15 @@ class ExtraTreesRegressor(ForestRegressor): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. bootstrap : boolean, optional (default=False) Whether bootstrap samples are used when building trees. @@ -1848,14 +1853,15 @@ class RandomTreesEmbedding(BaseForest): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. sparse_output : bool, optional (default=True) Whether or not to return a sparse CSR matrix, as default behavior, diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py index 39da7de21a166..b15ed82833fd6 100644 --- a/sklearn/ensemble/gradient_boosting.py +++ b/sklearn/ensemble/gradient_boosting.py @@ -1782,14 +1782,15 @@ class GradientBoostingClassifier(BaseGradientBoosting, ClassifierMixin): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. init : estimator, optional An estimator object that is used to compute the initial @@ -2241,14 +2242,15 @@ class GradientBoostingRegressor(BaseGradientBoosting, RegressorMixin): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. init : estimator, optional (default=None) An estimator object that is used to compute the initial diff --git a/sklearn/tree/tree.py b/sklearn/tree/tree.py index 2357ce3f508e4..faa83efbb7703 100644 --- a/sklearn/tree/tree.py +++ b/sklearn/tree/tree.py @@ -291,8 +291,9 @@ def fit(self, X, y, sample_weight=None, check_input=True, np.sum(sample_weight)) if self.min_impurity_split is not None: - warnings.warn("The min_impurity_split parameter is deprecated and" - " will be removed in version 0.21. " + warnings.warn("The min_impurity_split parameter is deprecated. " + "Its default value will change from 1e-7 to 0 in " + "version 0.23, and it will be removed in 0.25. " "Use the min_impurity_decrease parameter instead.", DeprecationWarning) min_impurity_split = self.min_impurity_split @@ -627,14 +628,15 @@ class DecisionTreeClassifier(BaseDecisionTree, ClassifierMixin): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. class_weight : dict, list of dicts, "balanced" or None, default=None Weights associated with classes in the form ``{class_label: weight}``. @@ -999,14 +1001,15 @@ class DecisionTreeRegressor(BaseDecisionTree, RegressorMixin): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. presort : bool, optional (default=False) Whether to presort the data to speed up the finding of best splits in @@ -1261,14 +1264,15 @@ class ExtraTreeClassifier(DecisionTreeClassifier): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. class_weight : dict, list of dicts, "balanced" or None, default=None Weights associated with classes in the form ``{class_label: weight}``. @@ -1444,14 +1448,15 @@ class ExtraTreeRegressor(DecisionTreeRegressor): .. versionadded:: 0.19 - min_impurity_split : float, + min_impurity_split : float, (default=1e-7) Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. .. deprecated:: 0.19 ``min_impurity_split`` has been deprecated in favor of - ``min_impurity_decrease`` in 0.19 and will be removed in 0.21. - Use ``min_impurity_decrease`` instead. + ``min_impurity_decrease`` in 0.19. The default value of + ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and it + will be removed in 0.25. Use ``min_impurity_decrease`` instead. max_leaf_nodes : int or None, optional (default=None) Grow a tree with ``max_leaf_nodes`` in best-first fashion.