Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: Add xlim/ylim parameters to DecisionBoundaryDisplay.from_estimator#31693

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ShauryaDusht wants to merge13 commits intoscikit-learn:main
base:main
Choose a base branch
Loading
fromShauryaDusht:feature/decision-boundary-xlim-ylim

Conversation

ShauryaDusht
Copy link
Contributor

@ShauryaDushtShauryaDusht commentedJul 2, 2025
edited by lucyleeow
Loading

Reference Issues/PRs

Towards#27462

What does this implement/fix? Explain your changes.

This PR addsxlim andylim parameters toDecisionBoundaryDisplay.from_estimator() to allow users to override the automatic data-based plot limits.

  • Addedxlim=None andylim=None parameters to method signature
  • Added validation to ensure limits are tuples with min < max
  • Modified limit calculation to use custom limits when provided
  • Added documentation for both parameters
  • Maintains backward compatibility

@github-actionsGitHub Actions
Copy link

github-actionsbot commentedJul 2, 2025
edited
Loading

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit:8149971. Link to the linter CI:here

Copy link
Member

@lucyleeowlucyleeow left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

Could you please add some tests and a whats new entry:https://github.com/scikit-learn/scikit-learn/blob/main/doc/whats_new/upcoming_changes/README.md

Copy link
Member

@lucyleeowlucyleeow left a comment

Choose a reason for hiding this comment

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

Let's also specify in the docstring thateps is ignored if bothxlim andylim given. Could we also move the the new kwargs to underneatheps?

@ShauryaDusht
Copy link
ContributorAuthor

Thanks for the swift review. I will add these changes soon.

@ShauryaDusht
Copy link
ContributorAuthor

Hi@lucyleeow
I've added the tests and the "whats new" entry.
SinceDecisionBoundaryDisplay.from_estimator() depends on matplotlib (which took me a while to understand), I've marked it to be skipped in CI tests. However, when matplotlib is available, all tests pass (verified locally).

Copy link
Member

@lucyleeowlucyleeow left a comment

Choose a reason for hiding this comment

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

Please place your tests in the existing decision boundary test:sklearn/inspection/_plot/tests/test_boundary_decision_display.py.
You will be able to use the test data and fixtures, so you don't have to repeat.

Your test cases are probably too long and more than what is actually needed. If you are using LLMs to help you with tests, please note that they tend to produce verbose code and careful oversight and review by yourself is probably best.

Note also that we don't use test classes. I am happy to take another lookafter you've carefully reviewed your tests. Thank you

StefanieSenger and ShauryaDusht reacted with thumbs up emoji
@ShauryaDusht
Copy link
ContributorAuthor

ShauryaDusht commentedJul 7, 2025
edited
Loading

I’ve moved the tests tosklearn/inspection/_plot/tests/test_boundary_decision_display.py as suggested.

Also removed test classes and refactored the cases to be more generalized

Thank you

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@lucyleeowlucyleeowlucyleeow left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ShauryaDusht@lucyleeow

[8]ページ先頭

©2009-2025 Movatter.jp