Skip to content

[MRG] DOC: Add display='diagram' guides to visualize estimators #18806

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

Closed

Conversation

hongshaoyang
Copy link
Contributor

Reference Issues/PRs

Closes #18305 .

What does this implement/fix? Explain your changes.

Any other comments?

@hongshaoyang hongshaoyang changed the title DOC: Add display='diagram' guides to visualize estimators [MRG] DOC: Add display='diagram' guides to visualize estimators Nov 10, 2020
@@ -91,7 +91,7 @@
print("model score: %.3f" % clf.score(X_test, y_test))

# %%
# HTML representation of ``Pipeline``
# HTML representation of ``Pipeline`` (Display Diagram)
Copy link
Member

Choose a reason for hiding this comment

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

You can revert this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following the discussion on #18305 which suggested putting that in for SEO purposes.

@@ -117,6 +117,12 @@ the test data::
>>> accuracy_score(pipe.predict(X_test), y_test)
0.97...

.. note:: Diagram rendering of estimators
Copy link
Member

Choose a reason for hiding this comment

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

I would create a section instead of just a note.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was following @NicolasHug 's direction of adding a note (#18305 (comment))

The default configuration for displaying a pipeline is 'text':
``set_config(display='text')``. To visualize the diagram in Jupyter
Notebook, use ``set_config(display='diagram')`` and then call the pipeline
object.
Copy link
Member

Choose a reason for hiding this comment

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

You can give an example such that it is rendered in the documentation. One without the diagram and one with the diagram

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately rendering the diagram in Getting Started is infeasible because it's not an image, it's interactive HTML. E.g. in the user guide section 6.1, it doesn't show the interactive HTML as well.

@NicolasHug
Copy link
Member

Thanks for the PR @hongshaoyang. Note that @reshamas had already opened a PR for this issue: #18758

As suggested in #18305 (comment), I think we should create an new dedicated example instead. Since #18758 is already open, I'll close this PR if you don't mind, but feel free to comment on the original issue if you're intersted

@NicolasHug NicolasHug closed this Nov 13, 2020
@hongshaoyang hongshaoyang deleted the 18305-displaydiagram branch June 9, 2021 08:38
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.

display='diagram' needs more prominence in documentation
3 participants