FIX potentially redundant marker argument#27043
Merged
Micky774 merged 4 commits intoscikit-learn:mainfrom Aug 9, 2023
Merged
Conversation
thomasjpfan
reviewed
Aug 9, 2023
sklearn/calibration.py
Outdated
| if name is not None: | ||
| line_kwargs["label"] = name | ||
| line_kwargs.update(**kwargs) | ||
| line_kwargs.setdefault("marker", "s") |
Member
There was a problem hiding this comment.
Can the default value be placed during the initiation of line_kwargs?
line_kwargs = {"marker": "s"}
Member
Author
There was a problem hiding this comment.
You are right! And that's probably cleaner 😅.
I addressed your comment in my latest commit.
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
thomasjpfan
reviewed
Aug 9, 2023
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
thomasjpfan
approved these changes
Aug 9, 2023
TamaraAtanasoska
pushed a commit
to TamaraAtanasoska/scikit-learn
that referenced
this pull request
Aug 21, 2023
Co-authored-by: ArturoAmorQ <arturo.amor-quiroz@polytechnique.edu> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
glemaitre
pushed a commit
to glemaitre/scikit-learn
that referenced
this pull request
Sep 18, 2023
Co-authored-by: ArturoAmorQ <arturo.amor-quiroz@polytechnique.edu> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
jeremiedbb
pushed a commit
that referenced
this pull request
Sep 20, 2023
Co-authored-by: ArturoAmorQ <arturo.amor-quiroz@polytechnique.edu> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
REDVM
pushed a commit
to REDVM/scikit-learn
that referenced
this pull request
Nov 16, 2023
Co-authored-by: ArturoAmorQ <arturo.amor-quiroz@polytechnique.edu> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
What does this implement/fix? Explain your changes.
The Comparison of Calibration of Classifiers example is raising a
UserWarning: marker is redundantly defined by the 'marker' keyword argument and the fmt string "s-" (-> marker='s'). The keyword argument will take precedence.As users may want to customize the marker as done in this example, this PR uses the
setdefaultmethod to check if'marker'is already a key inline_kwargs. If it's not present, it adds the key with the value's'. If it's already present, it does nothing, avoiding the redundancy.Any other comments?