Repository navigation
DOC Update Nearest Centroid DecisionBoundaryDisplay example - #33883
Merged
jeremiedbb merged 3 commits intoMay 5, 2026
Merged
Conversation
AnneBeyer
commented
Apr 28, 2026
AnneBeyer
commented
Apr 28, 2026
Comment on lines
33
to
+34
| y_pred = clf.predict(X) | ||
| print(shrinkage, np.mean(y == y_pred)) | ||
| acc = np.mean(y == y_pred) |
Member
Author
There was a problem hiding this comment.
Is there a reason to prefer this over clf.score(X, y)?
Member
There was a problem hiding this comment.
These days we don't want to promote using the default scorer of estimators. We could use accuracy_score though. But I would not put a lot of effort on this example. It's the kind of example that I believe we'd like to remove, or merge with other one(s) to have more complete examples.
Member
Author
There was a problem hiding this comment.
Good to know. I'll add this to my list.
26 tasks done
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
Towards #33557
What does this implement/fix? Explain your changes.
It now uses the default colors for the display and re-uses the colors from the display for the scatterplot.
I also added a link to the user guide and some more details.
AI usage disclosure
I used AI assistance for:
Any other comments?
It could make sense to use an example where the shrinkage setting has a larger effect, but since this issue/PR is mainly concerned with color consistency, I will leave this for the future.