Skip to content

Commit

Permalink
DOC Correction: max_depth is effective when max_leaf_nodes is not None (
Browse files Browse the repository at this point in the history
  • Loading branch information
ceshine authored and jnothman committed Aug 16, 2016
1 parent 42120e5 commit 0e1fd12
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
10 changes: 0 additions & 10 deletions sklearn/ensemble/forest.py
Expand Up @@ -777,7 +777,6 @@ class RandomForestClassifier(ForestClassifier):
The maximum depth of the tree. If None, then nodes are expanded until
all leaves are pure or until all leaves contain less than
min_samples_split samples.
Ignored if ``max_leaf_nodes`` is not None.
min_samples_split : int, float, optional (default=2)
The minimum number of samples required to split an internal node:
Expand All @@ -803,7 +802,6 @@ class RandomForestClassifier(ForestClassifier):
Grow trees with ``max_leaf_nodes`` in best-first fashion.
Best nodes are defined as relative reduction in impurity.
If None then unlimited number of leaf nodes.
If not None then ``max_depth`` will be ignored.
min_impurity_split : float, optional (default=1e-7)
Threshold for early stopping in tree growth. A node will split
Expand Down Expand Up @@ -984,7 +982,6 @@ class RandomForestRegressor(ForestRegressor):
The maximum depth of the tree. If None, then nodes are expanded until
all leaves are pure or until all leaves contain less than
min_samples_split samples.
Ignored if ``max_leaf_nodes`` is not None.
min_samples_split : int, float, optional (default=2)
The minimum number of samples required to split an internal node:
Expand All @@ -1010,7 +1007,6 @@ class RandomForestRegressor(ForestRegressor):
Grow trees with ``max_leaf_nodes`` in best-first fashion.
Best nodes are defined as relative reduction in impurity.
If None then unlimited number of leaf nodes.
If not None then ``max_depth`` will be ignored.
min_impurity_split : float, optional (default=1e-7)
Threshold for early stopping in tree growth. A node will split
Expand Down Expand Up @@ -1151,7 +1147,6 @@ class ExtraTreesClassifier(ForestClassifier):
The maximum depth of the tree. If None, then nodes are expanded until
all leaves are pure or until all leaves contain less than
min_samples_split samples.
Ignored if ``max_leaf_nodes`` is not None.
min_samples_split : int, float, optional (default=2)
The minimum number of samples required to split an internal node:
Expand All @@ -1177,7 +1172,6 @@ class ExtraTreesClassifier(ForestClassifier):
Grow trees with ``max_leaf_nodes`` in best-first fashion.
Best nodes are defined as relative reduction in impurity.
If None then unlimited number of leaf nodes.
If not None then ``max_depth`` will be ignored.
min_impurity_split : float, optional (default=1e-7)
Threshold for early stopping in tree growth. A node will split
Expand Down Expand Up @@ -1357,7 +1351,6 @@ class ExtraTreesRegressor(ForestRegressor):
The maximum depth of the tree. If None, then nodes are expanded until
all leaves are pure or until all leaves contain less than
min_samples_split samples.
Ignored if ``max_leaf_nodes`` is not None.
min_samples_split : int, float, optional (default=2)
The minimum number of samples required to split an internal node:
Expand All @@ -1383,7 +1376,6 @@ class ExtraTreesRegressor(ForestRegressor):
Grow trees with ``max_leaf_nodes`` in best-first fashion.
Best nodes are defined as relative reduction in impurity.
If None then unlimited number of leaf nodes.
If not None then ``max_depth`` will be ignored.
min_impurity_split : float, optional (default=1e-7)
Threshold for early stopping in tree growth. A node will split
Expand Down Expand Up @@ -1510,7 +1502,6 @@ class RandomTreesEmbedding(BaseForest):
The maximum depth of each tree. If None, then nodes are expanded until
all leaves are pure or until all leaves contain less than
min_samples_split samples.
Ignored if ``max_leaf_nodes`` is not None.
min_samples_split : int, float, optional (default=2)
The minimum number of samples required to split an internal node:
Expand All @@ -1536,7 +1527,6 @@ class RandomTreesEmbedding(BaseForest):
Grow trees with ``max_leaf_nodes`` in best-first fashion.
Best nodes are defined as relative reduction in impurity.
If None then unlimited number of leaf nodes.
If not None then ``max_depth`` will be ignored.
min_impurity_split : float, optional (default=1e-7)
Threshold for early stopping in tree growth. A node will split
Expand Down
3 changes: 0 additions & 3 deletions sklearn/ensemble/gradient_boosting.py
Expand Up @@ -1296,7 +1296,6 @@ class GradientBoostingClassifier(BaseGradientBoosting, ClassifierMixin):
depth limits the number of nodes in the tree. Tune this parameter
for best performance; the best value depends on the interaction
of the input variables.
Ignored if ``max_leaf_nodes`` is not None.
criterion : string, optional (default="friedman_mse")
The function to measure the quality of a split. Supported criteria
Expand Down Expand Up @@ -1359,7 +1358,6 @@ class GradientBoostingClassifier(BaseGradientBoosting, ClassifierMixin):
Grow trees with ``max_leaf_nodes`` in best-first fashion.
Best nodes are defined as relative reduction in impurity.
If None then unlimited number of leaf nodes.
If not None then ``max_depth`` will be ignored.
min_impurity_split : float, optional (default=1e-7)
Threshold for early stopping in tree growth. A node will split
Expand Down Expand Up @@ -1661,7 +1659,6 @@ class GradientBoostingRegressor(BaseGradientBoosting, RegressorMixin):
depth limits the number of nodes in the tree. Tune this parameter
for best performance; the best value depends on the interaction
of the input variables.
Ignored if ``max_leaf_nodes`` is not None.
criterion : string, optional (default="friedman_mse")
The function to measure the quality of a split. Supported criteria
Expand Down
2 changes: 0 additions & 2 deletions sklearn/tree/_tree.pyx
Expand Up @@ -285,8 +285,6 @@ cdef class BestFirstTreeBuilder(TreeBuilder):
The best node to expand is given by the node at the frontier that has the
highest impurity improvement.
NOTE: this TreeBuilder will ignore ``tree.max_depth`` .
"""
cdef SIZE_t max_leaf_nodes

Expand Down
4 changes: 0 additions & 4 deletions sklearn/tree/tree.py
Expand Up @@ -566,7 +566,6 @@ class DecisionTreeClassifier(BaseDecisionTree, ClassifierMixin):
The maximum depth of the tree. If None, then nodes are expanded until
all leaves are pure or until all leaves contain less than
min_samples_split samples.
Ignored if ``max_leaf_nodes`` is not None.
min_samples_split : int, float, optional (default=2)
The minimum number of samples required to split an internal node:
Expand All @@ -592,7 +591,6 @@ class DecisionTreeClassifier(BaseDecisionTree, ClassifierMixin):
Grow a tree with ``max_leaf_nodes`` in best-first fashion.
Best nodes are defined as relative reduction in impurity.
If None then unlimited number of leaf nodes.
If not None then ``max_depth`` will be ignored.
class_weight : dict, list of dicts, "balanced" or None, optional (default=None)
Weights associated with classes in the form ``{class_label: weight}``.
Expand Down Expand Up @@ -832,7 +830,6 @@ class DecisionTreeRegressor(BaseDecisionTree, RegressorMixin):
The maximum depth of the tree. If None, then nodes are expanded until
all leaves are pure or until all leaves contain less than
min_samples_split samples.
Ignored if ``max_leaf_nodes`` is not None.
min_samples_split : int, float, optional (default=2)
The minimum number of samples required to split an internal node:
Expand All @@ -858,7 +855,6 @@ class DecisionTreeRegressor(BaseDecisionTree, RegressorMixin):
Grow a tree with ``max_leaf_nodes`` in best-first fashion.
Best nodes are defined as relative reduction in impurity.
If None then unlimited number of leaf nodes.
If not None then ``max_depth`` will be ignored.
random_state : int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the random number generator;
Expand Down

0 comments on commit 0e1fd12

Please sign in to comment.