Skip to content

Conversation

@fkaren27
Copy link
Contributor

Reference Issues/PRs

towards #22406

This is a work in progress as part of the #pariswimlds sprint.

@fkaren27 fkaren27 changed the title WIP Improve the bayesian ridge example Improve the bayesian ridge example Mar 12, 2022
@fkaren27 fkaren27 marked this pull request as ready for review March 12, 2022 19:30
@lesteve lesteve changed the title Improve the bayesian ridge example DOC use notebook-style for plot_bayesian_ridge.py Mar 13, 2022
@lesteve
Copy link
Member

lesteve commented Mar 13, 2022

Thanks for your PR, FYI I edited the title of your PR so that it contains the example filename. The reason for this is that we have a script that updates the #22406 automatically and relies on the example filename being in the PR title.

Copy link
Member

@ogrisel ogrisel 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 PR @fkaren27!

I had a look at the rendering from the CI (see the "doc artifact" link):
https://181160-843222-gh.circle-artifacts.com/0/doc/auto_examples/linear_model/plot_bayesian_ridge.html

I think the 3 matplotlib figures would benefit from being each in their own cell. So please introduce new cell markers # %% to separate them.

Note that when doing so, the final line of the first cell will be:

plt.legend(loc="best", prop=dict(size=12)

the returned value of that function call will then be displayed in a yellow rectangle used to render the output of the cell in notebook-style examples. Since the string representation of a matplotlib legend object is not interesting to the reader, we silence such noisy output with a dummy variable assignment:

_ = plt.legend(loc="best", prop=dict(size=12)

You can also drop the final plt.show(), I think.

@lesteve lesteve added the Quick Review For PRs that are quick to review label Mar 14, 2022
@lesteve lesteve mentioned this pull request Mar 14, 2022
47 tasks
@ogrisel
Copy link
Member

ogrisel commented Mar 14, 2022

The black formatter complains on the CI. To automatically fixes those, you can run:

pip install black==22.1.0
black examples/linear_model/plot_bayesian_ridge.py

or directly using VS Code (ctrl-shift-p + "Format document...").

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

Thanks @fkaren27. I think the rendering would be improved by making the comments separating sections as titles

Co-authored-by: Jérémie du Boisberranger <[email protected]>
@lesteve lesteve merged commit d1a72af into scikit-learn:main Mar 18, 2022
@lesteve
Copy link
Member

lesteve commented Mar 18, 2022

Merging, thanks a lot!

glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Apr 6, 2022
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Loïc Estève <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Quick Review For PRs that are quick to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants