Skip to content

DOC - add decision boundary visualization to plot_gpc_iris - #34509

Merged
StefanieSenger merged 8 commits into
scikit-learn:mainfrom
mcvincekova:doc-33980
Jul 20, 2026
Merged

StefanieSenger merged 8 commits into
scikit-learn:mainfrom
mcvincekova:doc-33980

Conversation

@mcvincekova

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Addresses #33980.

What does this implement/fix? Explain your changes.

  • add usage of DecisionBoundaryDisplay.from_estimator
  • use colourblind-friendly colours in the final visual output

First time contributor introduction

Hello, I use scikit-learn as a go-to tool for prototyping and analytical work when the use-case allows it (i.e. I don't need power tools such as pytorch or LLMs).
This contribution was kick-started by the Sprints at Europython 2026 and is a way for me to finally give something back to this wonderful project.

AI usage disclosure

No AI used for this change.

Any other comments?

@github-actions

Copy link
Copy Markdown

Thank you for opening your first pull request to scikit-learn! 🎉

To help get your contribution reviewed, please make sure that:

  • You have filled out the pull request template.
  • The pull request addresses an existing issue that is ready for
    contribution (e.g. not tagged as "Needs Triage", "Needs Decision", ...).
    If you are proposing a new feature, please open an issue to discuss it first.
  • There are no other open pull requests already targeting the same issue.
  • You have followed the pull request checklist.
    In particular, linting and tests should pass.

@AnneBeyer AnneBeyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @mcvincekova! The output looks very nice already. I added two small comments below, then I'd say this one is good to go!

Comment on lines 65 to 66

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please check if the plot changes when you remove these two lines? If the output looks the same, you can also remove lines 30 and 37-40 above, which are now also computed inside the Display class.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You were indeed correct, the display class handles it.

@mcvincekova
mcvincekova requested a review from AnneBeyer July 18, 2026 15:05

@AnneBeyer AnneBeyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the quick response, @mcvincekova, LGTM now!

The example used to look like this
image
and with this PR now looks like this
image

So on top of simplifying the code and using more accessible colors, the change of using the display's default plotting method (contourf) also improves the illustration of the subtle differences the example is highlighting.

@StefanieSenger, could you have a look as well?

@StefanieSenger StefanieSenger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. Thank you very much @mcvincekova!
I've only got two nit comments.

@github-actions github-actions Bot added the CI:Linter failure The linter CI is failing on this PR label Jul 19, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Jul 19, 2026
@StefanieSenger
StefanieSenger merged commit 5a349c8 into scikit-learn:main Jul 20, 2026
33 checks passed
@StefanieSenger

Copy link
Copy Markdown
Member

Congrats on your first contribution to scikit-learn, @mcvincekova! 🎉 🎉 🎉

prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks done
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Sep 9, 2026
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