-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ENH Support sample weights in PartialDependenceDisplay.from_estimator #26644
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
Conversation
✔️ Linting PassedAll linting checks passed. Your pull request is in excellent shape! ☀️ Generated for commit: 956002d |
Kindly pinging @glemaitre, @lorentzenchr, @jeremiedbb here as you might be interested and already familiar with the previous PR. I wasn't creative in the test, as it was unclear to me what we want to evaluate. Therefore, any suggestions are welcome! |
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.
It looks good to me.
@jeremiedbb I think we need this one not to have a discrepancy between partial_dependence
and the display in 1.3.
I'm okay with that |
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.
LGTM
I just updated the branch with main. CI is green. I'm ok with it being merged as is. :) |
Thanks @vitaliset |
This PR fixes #24872.
Built on top of #25209.
As partial dependence of a model at a point is defined as an expectation, as #24872 points out, it should respect
sample_weight
if someone wishes to use it (for instance, when you know yourX
does not follow the distribution you are interested in).The prior PR (#25209) incorporated this logic into the
partial_dependence_plot
function. This current PR completes the integration by incorporating it intoPartialDependenceDisplay.from_estimator
.