Skip to content

Commit

Permalink
[MRG] documentation for random_state in forest.py (#15516)
Browse files Browse the repository at this point in the history
* documentation for random_state in forests

* move note to parameter

* same for RandomForestRegressor

* add doc for ExtraTreesRegressor and ExtraTreesClassifier

* skip line

* lint

* move note back to where it was

* add Glossary in RandomForestRegressor

* adding description for RandomTreesEmbedding

* small fix

* correct description for RandomTreesEmbedding
  • Loading branch information
MDouriez authored and jnothman committed Nov 28, 2019
1 parent 2aef81a commit 52b1991
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions sklearn/ensemble/_forest.py
Expand Up @@ -962,10 +962,11 @@ class RandomForestClassifier(ForestClassifier):
<n_jobs>` for more details.
random_state : int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the random number generator;
If RandomState instance, random_state is the random number generator;
If None, the random number generator is the RandomState instance used
by `np.random`.
Controls both the randomness of the bootstrapping of the samples used
when building trees (if ``bootstrap=True``) and the sampling of the
features to consider when looking for the best split at each node
(if ``max_features < n_features``).
See :term:`Glossary <random_state>` for details.
verbose : int, optional (default=0)
Controls the verbosity when fitting and predicting.
Expand Down Expand Up @@ -1278,10 +1279,11 @@ class RandomForestRegressor(ForestRegressor):
<n_jobs>` for more details.
random_state : int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the random number generator;
If RandomState instance, random_state is the random number generator;
If None, the random number generator is the RandomState instance used
by `np.random`.
Controls both the randomness of the bootstrapping of the samples used
when building trees (if ``bootstrap=True``) and the sampling of the
features to consider when looking for the best split at each node
(if ``max_features < n_features``).
See :term:`Glossary <random_state>` for details.
verbose : int, optional (default=0)
Controls the verbosity when fitting and predicting.
Expand Down Expand Up @@ -1540,7 +1542,7 @@ class ExtraTreesClassifier(ForestClassifier):
bootstrap : boolean, optional (default=False)
Whether bootstrap samples are used when building trees. If False, the
whole datset is used to build each tree.
whole dataset is used to build each tree.
oob_score : bool, optional (default=False)
Whether to use out-of-bag samples to estimate
Expand All @@ -1554,10 +1556,14 @@ class ExtraTreesClassifier(ForestClassifier):
<n_jobs>` for more details.
random_state : int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the random number generator;
If RandomState instance, random_state is the random number generator;
If None, the random number generator is the RandomState instance used
by `np.random`.
Controls 3 sources of randomness:
- the bootstrapping of the samples used when building trees
(if ``bootstrap=True``)
- the sampling of the features to consider when looking for the best
split at each node (if ``max_features < n_features``)
- the draw of the splits for each of the `max_features`
See :term:`Glossary <random_state>` for details.
verbose : int, optional (default=0)
Controls the verbosity when fitting and predicting.
Expand Down Expand Up @@ -1845,7 +1851,7 @@ class ExtraTreesRegressor(ForestRegressor):
bootstrap : boolean, optional (default=False)
Whether bootstrap samples are used when building trees. If False, the
whole datset is used to build each tree.
whole dataset is used to build each tree.
oob_score : bool, optional (default=False)
Whether to use out-of-bag samples to estimate the R^2 on unseen data.
Expand All @@ -1858,10 +1864,14 @@ class ExtraTreesRegressor(ForestRegressor):
<n_jobs>` for more details.
random_state : int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the random number generator;
If RandomState instance, random_state is the random number generator;
If None, the random number generator is the RandomState instance used
by `np.random`.
Controls 3 sources of randomness:
- the bootstrapping of the samples used when building trees
(if ``bootstrap=True``)
- the sampling of the features to consider when looking for the best
split at each node (if ``max_features < n_features``)
- the draw of the splits for each of the `max_features`
See :term:`Glossary <random_state>` for details.
verbose : int, optional (default=0)
Controls the verbosity when fitting and predicting.
Expand Down Expand Up @@ -2088,10 +2098,9 @@ class RandomTreesEmbedding(BaseForest):
<n_jobs>` for more details.
random_state : int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the random number generator;
If RandomState instance, random_state is the random number generator;
If None, the random number generator is the RandomState instance used
by `np.random`.
Controls the generation of the random `y` used to fit the trees
and the draw of the splits for each feature at the trees' nodes.
See :term:`Glossary <random_state>` for details.
verbose : int, optional (default=0)
Controls the verbosity when fitting and predicting.
Expand Down

0 comments on commit 52b1991

Please sign in to comment.