Skip to content

DOC Clarify what can be passed to the plotting utilities#16893

Merged
thomasjpfan merged 5 commits intoscikit-learn:masterfrom
justmarkham:patch-1
Apr 10, 2020
Merged

DOC Clarify what can be passed to the plotting utilities#16893
thomasjpfan merged 5 commits intoscikit-learn:masterfrom
justmarkham:patch-1

Conversation

@justmarkham
Copy link
Copy Markdown
Contributor

Reference Issues/PRs

None

What does this implement/fix? Explain your changes.

The documentation currently states that a "trained classifier" can be passed to plot_confusion_matrix. I think it would be useful to note explicitly that a pipeline ending in a classifier can also be passed to plot_confusion_matrix.

Any other comments?

Here are some options for the wording:

  1. Trained classifier, or a trained pipeline in which the last estimator is a classifier. (This is the wording I used in the commit.)
  2. Trained classifier, or a pipeline in which the last estimator is a classifier.
  3. Trained classifier, or a fitted pipeline in which the last estimator is a classifier.
  4. Fitted classifier, or a fitted pipeline in which the last estimator is a classifier.

If this PR is accepted, I'd be happy to also edit the docs for plot_precision_recall_curve and plot_roc_curve in a similar way (after I confirm that one can pass a pipeline to both of those as well).

Copy link
Copy Markdown
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Making the docstring clearer here is reasonable. I think I am in favor of:

Fitted classifier, or a fitted pipeline in which the last estimator is a classifier.

Since this is closest to the fit method.

@justmarkham justmarkham changed the title DOC Clarify what can be passed to plot_confusion_matrix DOC Clarify what can be passed to the plotting utilities Apr 10, 2020
@justmarkham
Copy link
Copy Markdown
Contributor Author

@thomasjpfan Thanks for the feedback!

I went ahead and tweaked the wording, and applied the same wording to plot_precision_recall_curve and plot_roc_curve.

If this PR is approved, would you mind advising me on the next steps? I assume there is some squashing of commits that takes place, but I'm not familiar with how to do that and any conventions that I would need to keep in mind.

Thanks!

@thomasjpfan
Copy link
Copy Markdown
Member

@justmarkham Pushing commits to this PR, as you are doing, is the preferred workflow. We prefer this because it allows the discussion's history to have the context of the previous commits.

When we merge with master, we are able to squash and merge the commits.

Copy link
Copy Markdown
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Minor suggestion but LGTM, thanks @justmarkham

@justmarkham
Copy link
Copy Markdown
Contributor Author

@thomasjpfan @NicolasHug Thanks! I've incorporated your feedback, and I'm all done with these changes unless there is additional feedback.

Copy link
Copy Markdown
Member

@thomasjpfan thomasjpfan 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 @justmarkham !

LGTM

@thomasjpfan thomasjpfan merged commit 0a93fc9 into scikit-learn:master Apr 10, 2020
@justmarkham justmarkham deleted the patch-1 branch April 11, 2020 02:25
gio8tisu pushed a commit to gio8tisu/scikit-learn that referenced this pull request May 15, 2020
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