Skip to content

DOC:Add inline example link to RFECV class docstring (#30621) #31476

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

Conversation

VirenPassi
Copy link
Contributor

@VirenPassi VirenPassi commented Jun 3, 2025

Reference Issues/PRs

Towards #30621.

What does this implement/fix?

Added an inline reference link to the example plot_rfe_with_cross_validation.py
in the docstring of the RFECV class (sklearn/feature_selection/_rfe.py).
This enhances documentation by allowing users to access the example directly from the class docs.

These changes are documentation-only and do not affect code functionality.

Copy link

github-actions bot commented Jun 3, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: f80aa62. Link to the linter CI: here

@VirenPassi
Copy link
Contributor Author

Hi maintainers, just wanted to kindly follow up on this PR. All checks have passed and this adds a relevant example link for RFECV, per Issue #30621. Ready for review when you have a moment. Thanks!

@VirenPassi VirenPassi marked this pull request as draft June 10, 2025 09:23
@VirenPassi VirenPassi marked this pull request as ready for review June 10, 2025 09:25
@VirenPassi VirenPassi changed the title Add inline example link to RFECV class docstring (#30621) DOC:Add inline example link to RFECV class docstring (#30621) Jun 11, 2025
Copy link
Member

@virchan virchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, @VirenPassi! I have a few comments.

In the PR description, please update the text to "Towards #30621" to avoid automatically closing the meta-issue when the PR is merged.

Additionally,

Comment on lines 567 to 571

See the example using RFE with cross-validation:
:ref:`sphx_glr_auto_examples_feature_selection_plot_rfe_with_cross_validation.py`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For a detailed example of using RFECV to select features when training a :class:~sklearn.linear_model.LogisticRegression, see <example_link>."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I've updated the PR description to use "Towards #30621" and replaced the docstring line with the suggested sentence. The changes have been pushed. Let me know if there's anything else you'd like me to adjust — thank you!

@VirenPassi VirenPassi force-pushed the doc-add-link-plot-rfe-with-cross-validation-30621 branch from 5c8f81b to a684ef7 Compare June 11, 2025 20:24
Copy link
Member

@virchan virchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for updating the PR, @VirenPassi! I have a few more comments.

Comment on lines 567 to 570

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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a blank line at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up! I’ve added the blank line after the example link as suggested. Let me know if there’s anything else!

Copy link
Member

@virchan virchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks, @VirenPassi!

@adrinjalali, would you like to have a look and merge this?

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this case it makes more sense to have it in the examples section of the docstring. So I've moved it. Thanks for the PR @VirenPassi

@adrinjalali adrinjalali enabled auto-merge (squash) June 18, 2025 11:46
@adrinjalali adrinjalali merged commit 2ca6d4d into scikit-learn:main Jun 18, 2025
36 checks passed
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 15, 2025
@jeremiedbb jeremiedbb mentioned this pull request Jul 15, 2025
13 tasks
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants