Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: replace plot_random_dataset with snippets in docstrings #29933

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

Merged
merged 8 commits into from
Sep 29, 2024

Conversation

yuanx749
Copy link
Contributor

Reference Issues/PRs

Part of #27151

What does this implement/fix? Explain your changes.

Replace Plot randomly generated classification dataset with snippets in the respective docstrings.

Any other comments?

Copy link

github-actions bot commented Sep 26, 2024

✔️ Linting Passed

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

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

@yuanx749 yuanx749 marked this pull request as ready for review September 26, 2024 08:41
@yuanx749
Copy link
Contributor Author

ping @ArturoAmorQ for review.

@saldanhad
Copy link
Contributor

saldanhad commented Sep 28, 2024

Hi @yuanx749, Nicely done!, just a few suggestions here, in case they can help improve the readability and navigation for make_classification:

  • If my understanding is correct here, modifying the doc strings under _sample_generator.py adds it to make_classification api reference. With the intention to not overwhelm the reader and the fact that the same example under Plot randomly generated classification dataset is in the user guide, would it be better to add the code part such that it shows up here: user guide
  • We can then modify the line under make_classification to something like: For an example usage and to learn mode, please refer to the: User Guide
    @ArturoAmorQ wdyt?

Either way, please update the redirects part under doc/conf.py depending on the approach approved.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Also as mention by @saldanhad, we need the redirection in conf.py. I think that pointing the following example will be safe: https://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html#sphx-glr-auto-examples-classification-plot-classifier-comparison-py

Copy link
Contributor Author

@yuanx749 yuanx749 left a comment

Choose a reason for hiding this comment

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

Thanks for the suggestions and I agree. @saldanhad @glemaitre . This will make the plots more compact.

:scale: 50
:align: center
:include-source: False
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code snippet is a bit long if placed here, so I just hide the code. WDYT @glemaitre ?

@glemaitre glemaitre self-requested a review September 29, 2024 08:43
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Thanks @yuanx749

I push a small change such that we split the discussion for each function and add the snippet of code such that this we have shorted snippet. It looks more natural.

If the CI pass, I'll merge.

@glemaitre glemaitre enabled auto-merge (squash) September 29, 2024 16:34
@glemaitre glemaitre merged commit bdba1da into scikit-learn:main Sep 29, 2024
30 checks passed
@yuanx749 yuanx749 deleted the plot_random branch September 30, 2024 00:58
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