scikit-learn icon indicating copy to clipboard operation
scikit-learn copied to clipboard

[mrg] ENH Add custom_range argument for partial dependence - version 2

Open stephenpardy opened this issue 2 years ago • 8 comments

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?

stephenpardy avatar Apr 17 '23 22:04 stephenpardy

@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?

stephenpardy avatar Apr 24 '23 13:04 stephenpardy

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 avatar Apr 28 '23 15:04 thomasjpfan

@thomasjpfan all tests now passing. Thank you.

stephenpardy avatar May 01 '23 18:05 stephenpardy

✔️ Linting Passed

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

Generated for commit: 37b4ca9. Link to the linter CI: here

github-actions[bot] avatar Jun 21 '23 18:06 github-actions[bot]

@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.

stephenpardy avatar Aug 28 '23 15:08 stephenpardy

@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.

mayer79 avatar Jan 24 '24 08:01 mayer79

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 avatar Feb 05 '24 08:02 mayer79

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.

stephenpardy avatar Feb 06 '24 15:02 stephenpardy