-
-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
[MRG] Adds Plotting API to Partial Dependence #14646
Changes from 1 commit
fa93505
d1dc257
1dac62c
bc45123
9d67f6a
5129289
6f5407e
8bc2433
4aa273c
5263235
045aa8f
75f8ed8
5fddc5f
396f1cb
bd121c3
422992e
ca532d7
7316ef5
9b916cf
ec47bd8
170a1b5
9ad9477
cab552a
0f5dee1
e7965d9
24ee8b0
d339328
f7e946d
480bcef
e9e5d3a
4b50a8b
f77f5d1
612a80e
a8182d8
6c3a6c9
42e0c9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,16 +23,16 @@ class PartialDependenceDisplay: | |
|
||
Parameters | ||
---------- | ||
pd_results : list of (ndarray, ndarray) | ||
pd_results : (ndarray, ndarray) list | ||
Results of `sklearn.inspection.partial_dependence` for ``features``. | ||
glemaitre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Each tuple corresponds to a (averaged_predictions, grid). | ||
|
||
features : list of {(int, ), (int, int)} | ||
features {(int, ), (int, int)} list | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did I miss a discussion about this style? |
||
Indices of features for a given plot. A tuple of one integer will plot | ||
a partial dependence curve of one feature. A tuple of two integers will | ||
plot a two-way partial dependence curve as a contour plot. | ||
|
||
feature_names : list of str | ||
feature_names : str list | ||
Feature names corrsponding to the indicies in ``features``. | ||
|
||
target_idx : int | ||
|
@@ -96,8 +96,7 @@ def plot(self, ax=None, n_cols=3, line_kw=None, contour_kw=None, fig=None): | |
|
||
Parameters | ||
---------- | ||
ax : Matplotlib axes, list of Matplotlib axes, ndarray of Matplotlib \ | ||
Axes, default=None | ||
ax : Matplotlib axes or Matplotlib axes array-like, default=None | ||
Axes to plot the partial dependence curves. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. incorrect indentation in this whole section, doc isn't rendered properly |
||
- If a single axes is given, it is treated as a bounding axes and | ||
a grid of partial depedendence plots will be drawn within these | ||
|
@@ -110,15 +109,15 @@ def plot(self, ax=None, n_cols=3, line_kw=None, contour_kw=None, fig=None): | |
n_cols : int, default=3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I hate the way this is currently done and we should be doing what dabl is doing or https://github.com/matplotlib/grid-strategy is doing but that's for another day lol. |
||
The maximum number of columns in the grid plot. | ||
|
||
line_kw : dict or None, default=None | ||
line_kw : dict, default=None | ||
Dict with keywords passed to the `matplotlib.pyplot.plot` call. | ||
For one-way partial dependence plots. | ||
|
||
contour_kw : dict or None, default=None | ||
contour_kw : dict, default=None | ||
Dict with keywords passed to the `matplotlib.pyplot.contourf` | ||
call for two-way partial dependence plots. | ||
|
||
fig : Matplotlib figure object or None, default=None | ||
fig : Matplotlib figure object, default=None | ||
A figure object onto which the plots will be drawn, after the | ||
figure has been cleared. By default, a new one is created. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -482,8 +482,7 @@ def plot_partial_dependence(estimator, X, features, feature_names=None, | |
Dict with keywords passed to the ``matplotlib.pyplot.contourf`` call. | ||
For two-way partial dependence plots. | ||
|
||
ax : Matplotlib axes, list of Matplotlib axes, ndarray of Matplotlib \ | ||
Axes, default=None | ||
ax : Matplotlib axes or Matplotlib axes array-like, default=None | ||
Axes to plot the partial dependence curves. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue about rendered docs |
||
- If a single axes is given, it is treated as a bounding axes and | ||
a grid of partial depedendence plots will be drawn within these | ||
|
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.
list of tuples?