Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG] documentation for random_state in forest.py #15516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 19, 2019
53 changes: 31 additions & 22 deletions sklearn/ensemble/_forest.py
Original file line number Diff line number Diff line change
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