[mrg] ENH Add custom_range argument for partial dependence - version 2
Reference Issues/PRs
Fixes https://github.com/scikit-learn/scikit-learn/issues/20890 and is a followup to the stale PR - https://github.com/scikit-learn/scikit-learn/pull/21033
What does this implement/fix? Explain your changes.
This PR allows users to specify a custom_range of values to calculate partial depedency for some or all of the features.
The api is custom_range={feature: array-like of grid values}.
Any other comments?
@thomasjpfan this is the update of #21033.
I am having CI/CD challenges with the Black linter - the current format fails the ci/circleci: lint step, but changing the code to the requested format causes the same line to fail the Azure linting step. I think there might be a mismatch in the Black settings?
We recently updated the black version on main. Sync up this PR with main, so that this PR picks up the new black version in the CI.
@thomasjpfan all tests now passing. Thank you.
✔️ Linting Passed
All linting checks passed. Your pull request is in excellent shape! ☀️
@thomasjpfan I understand that this is a large PR, but I am wondering if there is anything else I need to do to get it in the review queue. Thank you.
@thomasjpfan : this functionality is very high up on my wish list, e.g., to reorder the categories of a discrete feature into a natural order. How can we bring this to main?
Having a smooth inspection module is extremely important in practice.
Removed (wrong) comment of mine regarding Friedman's H statistic. To calculate it, we would need to be able to pass a custom grid also for the 2-dimensional case.
Removed (wrong) comment of mine regarding Friedman's H statistic. To calculate it, we would need to be able to pass a custom grid also for the 2-dimensional case.
@mayer79 I just tested this last night and the custom grid is picked up in the 2D case as well.