-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] FEA ICE lines individually colored by feature values #25807
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
Open
lurue101
wants to merge
26
commits into
scikit-learn:main
Choose a base branch
from
lurue101:ice_lines_individually_colored
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[MRG] FEA ICE lines individually colored by feature values #25807
lurue101
wants to merge
26
commits into
scikit-learn:main
from
lurue101:ice_lines_individually_colored
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # sklearn/inspection/_plot/tests/test_plot_partial_dependence.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
What does this implement/fix? Explain your changes.
This PR introduces a new feature, which is an extension of the Individual Conditional Expectation (ICE) Plots.
So far a single color for the ICE lines could be chosen by the user (in this case blue):
This extension allows coloring each line according to the values of another feature. For this, the user just has to pass a list of values. In this case, we use the discrete "workingday" feature from the bike rental dataset. True indicates workingday, false the weekend. This is as easy as just passing the series as the "color" parameter in the ice_lines_kw:
It also works with continuous features, for example, the hour of the bike rental:
The advantage of this is that we get a more detailed picture and can visualize dependencies between the features.
In the first example (all lines in blue) all the plot tells us is that roughly half the lines show a sharp increase in bike rentals (Partial dependence) once the temperature rises above 18°, but it is unclear why some lines show this increase and others not.
With the new functionality, it is possible to dig deeper: The increase in bike rentals almost exclusively happens on the weekend. Possibly because during the week people need to get to and back from work independent of the temperature, whereas on the weekend warmer weather increases the number of bike rentals.
Any other comments?
The example and data is taken from here:
https://scikit-learn.org/stable/auto_examples/inspection/plot_partial_dependence.html
The plots above are also added to this page. The documentation renders well when I tested it, but the output doesn't show up.
I can't understand why the checks regarding matplotlib.colormaps fail, I can run it locally. This was also an attribute that was suggested a DeprecationWarning in matplotlib