From 01de02ed1cfac7b0bb915f88f7fae1da4f0fe1b4 Mon Sep 17 00:00:00 2001 From: KALLA GANASEKHAR Date: Fri, 30 May 2025 16:08:30 +0530 Subject: [PATCH 1/5] DOC: Add plot_ensemble_oob example reference in RandomForestClassifier docstring --- sklearn/ensemble/_forest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sklearn/ensemble/_forest.py b/sklearn/ensemble/_forest.py index 5def6ac60816b..70ba02e737ca8 100644 --- a/sklearn/ensemble/_forest.py +++ b/sklearn/ensemble/_forest.py @@ -1186,6 +1186,9 @@ class RandomForestClassifier(ForestClassifier): For a comparison between tree-based ensemble models see the example :ref:`sphx_glr_auto_examples_ensemble_plot_forest_hist_grad_boosting_comparison.py`. + + For an illustration of out-of-bag (OOB) error estimation, see the example + :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. This estimator has native support for missing values (NaNs). During training, the tree grower learns at each split point whether samples with missing values From 05b01085552b6cfda5eb57e52513896d86ecd572 Mon Sep 17 00:00:00 2001 From: KALLA GANASEKHAR Date: Fri, 30 May 2025 16:29:23 +0530 Subject: [PATCH 2/5] DOC: Add plot_ensemble_oob example reference in RandomForestClassifier docstring --- sklearn/ensemble/_forest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sklearn/ensemble/_forest.py b/sklearn/ensemble/_forest.py index 70ba02e737ca8..e78d9743f4b98 100644 --- a/sklearn/ensemble/_forest.py +++ b/sklearn/ensemble/_forest.py @@ -1186,7 +1186,6 @@ class RandomForestClassifier(ForestClassifier): For a comparison between tree-based ensemble models see the example :ref:`sphx_glr_auto_examples_ensemble_plot_forest_hist_grad_boosting_comparison.py`. - For an illustration of out-of-bag (OOB) error estimation, see the example :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. From a4016fa7f9b9c9ca82c7b2b8df018cb6fefc75ff Mon Sep 17 00:00:00 2001 From: KALLA GANASEKHAR Date: Sun, 1 Jun 2025 03:54:21 +0530 Subject: [PATCH 3/5] DOC: Move OOB example reference under `oob_score` parameter --- sklearn/ensemble/_forest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sklearn/ensemble/_forest.py b/sklearn/ensemble/_forest.py index e78d9743f4b98..c55e09fa43738 100644 --- a/sklearn/ensemble/_forest.py +++ b/sklearn/ensemble/_forest.py @@ -1186,8 +1186,6 @@ class RandomForestClassifier(ForestClassifier): For a comparison between tree-based ensemble models see the example :ref:`sphx_glr_auto_examples_ensemble_plot_forest_hist_grad_boosting_comparison.py`. - For an illustration of out-of-bag (OOB) error estimation, see the example - :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. This estimator has native support for missing values (NaNs). During training, the tree grower learns at each split point whether samples with missing values @@ -1300,6 +1298,9 @@ class RandomForestClassifier(ForestClassifier): Provide a callable with signature `metric(y_true, y_pred)` to use a custom metric. Only available if `bootstrap=True`. + For an illustration of out-of-bag (OOB) error estimation, see the example + :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. + n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`, :meth:`decision_path` and :meth:`apply` are all parallelized over the From ad4f9dc6629ab284a85f0927e7ec1334d34cdb4e Mon Sep 17 00:00:00 2001 From: KALLA GANASEKHAR Date: Sun, 1 Jun 2025 04:40:28 +0530 Subject: [PATCH 4/5] DOC: Add OOB example reference under `oob_score` parameter in RandomForestClassifier --- sklearn/ensemble/_forest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/ensemble/_forest.py b/sklearn/ensemble/_forest.py index c55e09fa43738..d59aecf75b125 100644 --- a/sklearn/ensemble/_forest.py +++ b/sklearn/ensemble/_forest.py @@ -1298,8 +1298,8 @@ class RandomForestClassifier(ForestClassifier): Provide a callable with signature `metric(y_true, y_pred)` to use a custom metric. Only available if `bootstrap=True`. - For an illustration of out-of-bag (OOB) error estimation, see the example - :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. + For an illustration of out-of-bag (OOB) error estimation, see the example + :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`, From eef609875cd610c3c248072bc1ab8790f1ab7c3d Mon Sep 17 00:00:00 2001 From: KALLA GANASEKHAR Date: Tue, 3 Jun 2025 05:08:37 +0530 Subject: [PATCH 5/5] DOC: Add plot_ensemble_oob example reference in RandomForestRegressor, ExtraTreesClassifier and ExtraTreesRegressor docstring --- sklearn/ensemble/_forest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sklearn/ensemble/_forest.py b/sklearn/ensemble/_forest.py index d59aecf75b125..5b27e789b1d13 100644 --- a/sklearn/ensemble/_forest.py +++ b/sklearn/ensemble/_forest.py @@ -1712,6 +1712,9 @@ class RandomForestRegressor(ForestRegressor): Provide a callable with signature `metric(y_true, y_pred)` to use a custom metric. Only available if `bootstrap=True`. + For an illustration of out-of-bag (OOB) error estimation, see the example + :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. + n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`, :meth:`decision_path` and :meth:`apply` are all parallelized over the @@ -2057,6 +2060,9 @@ class ExtraTreesClassifier(ForestClassifier): Provide a callable with signature `metric(y_true, y_pred)` to use a custom metric. Only available if `bootstrap=True`. + For an illustration of out-of-bag (OOB) error estimation, see the example + :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. + n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`, :meth:`decision_path` and :meth:`apply` are all parallelized over the @@ -2452,6 +2458,9 @@ class ExtraTreesRegressor(ForestRegressor): Provide a callable with signature `metric(y_true, y_pred)` to use a custom metric. Only available if `bootstrap=True`. + For an illustration of out-of-bag (OOB) error estimation, see the example + :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`. + n_jobs : int, default=None The number of jobs to run in parallel. :meth:`fit`, :meth:`predict`, :meth:`decision_path` and :meth:`apply` are all parallelized over the