From 0145b13004bdf6a30f2cbc90cf51cb1b99cf5234 Mon Sep 17 00:00:00 2001 From: Martin Hirzel Date: Thu, 11 Feb 2021 17:14:07 -0500 Subject: [PATCH] Documented dependency of oob_score upon bootstrap as per Issue #19431. --- sklearn/ensemble/_bagging.py | 4 ++-- sklearn/ensemble/_forest.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sklearn/ensemble/_bagging.py b/sklearn/ensemble/_bagging.py index 58104d23fcf4e..070bc374f3123 100644 --- a/sklearn/ensemble/_bagging.py +++ b/sklearn/ensemble/_bagging.py @@ -488,7 +488,7 @@ class BaggingClassifier(ClassifierMixin, BaseBagging): oob_score : bool, default=False Whether to use out-of-bag samples to estimate - the generalization error. + the generalization error. Only available if bootstrap=True. warm_start : bool, default=False When set to True, reuse the solution of the previous call to fit @@ -897,7 +897,7 @@ class BaggingRegressor(RegressorMixin, BaseBagging): oob_score : bool, default=False Whether to use out-of-bag samples to estimate - the generalization error. + the generalization error. Only available if bootstrap=True. warm_start : bool, default=False When set to True, reuse the solution of the previous call to fit diff --git a/sklearn/ensemble/_forest.py b/sklearn/ensemble/_forest.py index c97b5b9f12528..c0b190c60ef54 100644 --- a/sklearn/ensemble/_forest.py +++ b/sklearn/ensemble/_forest.py @@ -1075,6 +1075,7 @@ class RandomForestClassifier(ForestClassifier): oob_score : bool, default=False Whether to use out-of-bag samples to estimate the generalization score. + Only available if bootstrap=True. n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`, @@ -1398,6 +1399,7 @@ class RandomForestRegressor(ForestRegressor): oob_score : bool, default=False Whether to use out-of-bag samples to estimate the generalization score. + Only available if bootstrap=True. n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`, @@ -1680,6 +1682,7 @@ class ExtraTreesClassifier(ForestClassifier): oob_score : bool, default=False Whether to use out-of-bag samples to estimate the generalization score. + Only available if bootstrap=True. n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`, @@ -1999,6 +2002,7 @@ class ExtraTreesRegressor(ForestRegressor): oob_score : bool, default=False Whether to use out-of-bag samples to estimate the generalization score. + Only available if bootstrap=True. n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`,