Skip to content

Conversation

@ingeliza
Copy link
Contributor

@ingeliza ingeliza commented Apr 10, 2022

Reference Issues/PRs

Issue #22406 fixed file examples/neural_networks/plot_rbm_logistic_classification.py

What does this implement/fix? Explain your changes.

The text in the file was difficult to read because it was not in notebook-style. I replaced long lines of "###" with "# %%" syntax so now it's more readable.

Any other comments?

Copy link
Contributor

@jsilke jsilke 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! Overall it looks good, but I do have a couple of comments. Please let me know what you think.

from sklearn.neural_network import BernoulliRBM
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import minmax_scale
from sklearn.base import clone
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we could move the imports to the cells in which they are first used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good point, thank you!

Comment on lines 125 to 126
% (metrics.classification_report(Y_test, Y_pred))
)
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be nice to split this cell so that we don't need to scroll through the output to look at both classification reports.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your comments! Should I make these changes as a new PR?

Copy link
Member

Choose a reason for hiding this comment

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

I have tackled @jsilke's comment in one of my commits you can see the rendered example in the development doc here

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

lesteve commented Apr 20, 2022

For some weird reasons, CircleCI did not run on the example, I updated your branch to rerun the CI and be able to see the generated doc for the example.

@lesteve
Copy link
Member

lesteve commented Apr 22, 2022

Merging, thanks a lot @ingeliza and @jsilke!

@lesteve lesteve changed the title DOC Fix notebook-style (#22406) examples/neural_networks/plot_rbm_logistic_classification.py DOC use notebook-style for plot_rbm_logistic_classification.py Apr 22, 2022
@lesteve lesteve merged commit 9b9f9dc into scikit-learn:main Apr 22, 2022
@ingeliza ingeliza deleted the fix-notebook-style-example branch April 25, 2022 18:41
jjerphan pushed a commit to jjerphan/scikit-learn that referenced this pull request Apr 29, 2022
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.

3 participants