From 473133d5ed766c7d87aba5dac8a8ece400e27d56 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Wed, 4 Jun 2025 05:06:58 +0530 Subject: [PATCH 1/5] Add inline link to plot_rfe_with_cross_validation example in RFECV docstring --- sklearn/feature_selection/_rfe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sklearn/feature_selection/_rfe.py b/sklearn/feature_selection/_rfe.py index d2bd78e225a54..205c9a956d7f5 100644 --- a/sklearn/feature_selection/_rfe.py +++ b/sklearn/feature_selection/_rfe.py @@ -563,7 +563,10 @@ class RFECV(RFE): The performance of each :class:`RFE` selector is evaluated using `scoring` for different numbers of selected features and aggregated together. Finally, the scores are averaged across folds and the number of features selected is set to the number - of features that maximize the cross-validation score. + of features that maximize the cross-validation score, as illustrated in the + :ref:`example using RFE with cross-validation + `. + See glossary entry for :term:`cross-validation estimator`. Read more in the :ref:`User Guide `. From aa6c15120e0aed46ec00753dce6fca44f9648089 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Wed, 4 Jun 2025 15:10:07 +0530 Subject: [PATCH 2/5] Fix formatting: resolved trailing whitespace and line length in RFECV docstring --- sklearn/feature_selection/_rfe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sklearn/feature_selection/_rfe.py b/sklearn/feature_selection/_rfe.py index 205c9a956d7f5..d93b89412f9d5 100644 --- a/sklearn/feature_selection/_rfe.py +++ b/sklearn/feature_selection/_rfe.py @@ -563,7 +563,8 @@ class RFECV(RFE): The performance of each :class:`RFE` selector is evaluated using `scoring` for different numbers of selected features and aggregated together. Finally, the scores are averaged across folds and the number of features selected is set to the number - of features that maximize the cross-validation score, as illustrated in the + of features that maximize the cross-validation score, as illustrated in the + following example: :ref:`example using RFE with cross-validation `. From a684ef720f889bcb353d1b8cb13b5afe5c8971f5 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Wed, 4 Jun 2025 16:08:52 +0530 Subject: [PATCH 3/5] Fix docstring formatting for RFECV: add safe example ref --- sklearn/feature_selection/_rfe.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sklearn/feature_selection/_rfe.py b/sklearn/feature_selection/_rfe.py index d93b89412f9d5..9438e2a719a79 100644 --- a/sklearn/feature_selection/_rfe.py +++ b/sklearn/feature_selection/_rfe.py @@ -563,10 +563,12 @@ class RFECV(RFE): The performance of each :class:`RFE` selector is evaluated using `scoring` for different numbers of selected features and aggregated together. Finally, the scores are averaged across folds and the number of features selected is set to the number - of features that maximize the cross-validation score, as illustrated in the - following example: - :ref:`example using RFE with cross-validation - `. + of features that maximize the cross-validation score. + + For a detailed example of using RFECV to select features when training a + :class:`~sklearn.linear_model.LogisticRegression`, see + :ref:`sphx_glr_auto_examples_feature_selection_plot_rfe_with_cross_validation.py`. + See glossary entry for :term:`cross-validation estimator`. From fbaf4dca067d8736d000e370717abe2f59756fd4 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Fri, 13 Jun 2025 01:58:15 +0530 Subject: [PATCH 4/5] DOC: Reworded RFECV example sentence as suggested by reviewer --- sklearn/feature_selection/_rfe.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sklearn/feature_selection/_rfe.py b/sklearn/feature_selection/_rfe.py index 9438e2a719a79..a2a79c32dc6ca 100644 --- a/sklearn/feature_selection/_rfe.py +++ b/sklearn/feature_selection/_rfe.py @@ -568,8 +568,6 @@ class RFECV(RFE): For a detailed example of using RFECV to select features when training a :class:`~sklearn.linear_model.LogisticRegression`, see :ref:`sphx_glr_auto_examples_feature_selection_plot_rfe_with_cross_validation.py`. - - See glossary entry for :term:`cross-validation estimator`. Read more in the :ref:`User Guide `. From fed390566b7c4fe695eb29187832e80b79912d13 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sat, 14 Jun 2025 16:22:43 +0530 Subject: [PATCH 5/5] DOC: Fix trailing whitespace and add blank line after RFECV example link --- sklearn/feature_selection/_rfe.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sklearn/feature_selection/_rfe.py b/sklearn/feature_selection/_rfe.py index a2a79c32dc6ca..a0b65bb6206f1 100644 --- a/sklearn/feature_selection/_rfe.py +++ b/sklearn/feature_selection/_rfe.py @@ -568,6 +568,7 @@ class RFECV(RFE): For a detailed example of using RFECV to select features when training a :class:`~sklearn.linear_model.LogisticRegression`, see :ref:`sphx_glr_auto_examples_feature_selection_plot_rfe_with_cross_validation.py`. + See glossary entry for :term:`cross-validation estimator`. Read more in the :ref:`User Guide `.