Skip to content

Commit 1c33a6f

Browse files
committed
Merge pull request #4489 from betatim/rf-oob-docs
[MRG+1] Document oob estimates of RandomForest* and Bagging*
2 parents 6e54079 + 88811be commit 1c33a6f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

doc/modules/ensemble.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ taking as input a user-specified base estimator along with parameters
6565
specifying the strategy to draw random subsets. In particular, ``max_samples``
6666
and ``max_features`` control the size of the subsets (in terms of samples and
6767
features), while ``bootstrap`` and ``bootstrap_features`` control whether
68-
samples and features are drawn with or without replacement. As an example, the
68+
samples and features are drawn with or without replacement. When using a subset
69+
of the available samples the generalization error can be estimated with the
70+
out-of-bag samples by setting ``oob_score=True``. As an example, the
6971
snippet below illustrates how to instantiate a bagging ensemble of
7072
:class:`KNeighborsClassifier` base estimators, each built on random subsets of
7173
50% of the samples and 50% of the features.
@@ -207,6 +209,9 @@ should always be cross-validated. In addition, note that in random forests,
207209
bootstrap samples are used by default (``bootstrap=True``)
208210
while the default strategy for extra-trees is to use the whole dataset
209211
(``bootstrap=False``).
212+
When using bootstrap sampling the generalization error can be estimated
213+
on the left out or out-of-bag samples. This can be enabled by
214+
setting ``oob_score=True``.
210215

211216
Parallelization
212217
---------------

0 commit comments

Comments
 (0)