-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FIX warning using polars DataFrames in DecisionBoundaryDisplay.from_estimator #28718
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX warning using polars DataFrames in DecisionBoundaryDisplay.from_estimator #28718
Conversation
bcbc83a
to
b5c5044
Compare
b5c5044
to
e729040
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @patrickkwang. ping @glemaitre who made the fix for pandas dataframes for another review.
sklearn/inspection/_plot/tests/test_boundary_decision_display.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an entry in the v1.4.rst
change log. Otherwise LGTM. Thanks @patrickkwang.
Done. |
2306fb0
to
3593d79
Compare
We've decided that the 1.4.2 release will only be about numpy 2 support, so I moved the changelog entry into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM.
Co-authored-by: Guillaume Lemaitre <[email protected]>
Thanks @patrickkwang |
Reference Issues/PRs
Fixes #28717, which is analogous to #23311, but for polars.
See also #25896.
What does this implement/fix? Explain your changes.
This fix is analogous to #23318. We identify when the predictors passed to
DecisionBoundaryPlot.from_estimator
is a polars DataFrame and refrain from converting it to a numpy array and stripping the column names.Any other comments?
The way we do this is a bit awkward because we want to avoid importing polars. A nicer way to do this would be something like the following:
... but that would require
import polars as pl
.Instead we drop the existing columns and add columns with the same names and the data from
meshgrid
.