Skip to content

Demo of Two-way Part Dep Plots - #1919

Merged
chukarsten merged 10 commits into
mainfrom
1835-2way_partial_dependence_plots
Mar 9, 2021
Merged

chukarsten merged 10 commits into
mainfrom
1835-2way_partial_dependence_plots

Conversation

@chukarsten

@chukarsten chukarsten commented Mar 3, 2021 •

Copy link
Copy Markdown
Contributor

Addresses #1835

Added some updates to the model_understanding.ipynb!

image

image

"metadata": {},
"outputs": [],
"source": [
"partial_dependence(pipeline, X, features=('worst perimeter', 'worst radius'))"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why, but the two-way partial dependence calculation takes longer than the graph_partial_dependence function, which, iirc, calls partial_dependence. It takes a fair amount of time...5 minutes? We would be accepting an increase to the build_docs runtime.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we set grid_resolution=20 it should take a lot less time (it's what the graph_partial_dependence call below is doing.)

I believe this scales quadratically with the grid size in the two-way case and if so we should make a note of it here and/or the docstring.

assert np.array_equal(data['y'], mock_cb_thresholds.return_value['score'])


def check_partial_dependence_dataframe(pipeline, part_dep, grid_size=20):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the partial_dependence tests over to their own file for organizational purposes.

@freddyaboulton freddyaboulton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chukarsten Looks good! I left a comment about using a smaller grid size in the notebook to speed it up.

"metadata": {},
"outputs": [],
"source": [
"partial_dependence(pipeline, X, features=('worst perimeter', 'worst radius'))"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we set grid_resolution=20 it should take a lot less time (it's what the graph_partial_dependence call below is doing.)

I believe this scales quadratically with the grid size in the two-way case and if so we should make a note of it here and/or the docstring.

@chukarsten
chukarsten force-pushed the 1835-2way_partial_dependence_plots branch from 74ceb79 to 5ba4a70 Compare March 4, 2021 15:42
@codecov

codecov Bot commented Mar 4, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1919 (d3a487c) into main (c4306f6) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             main    #1919     +/-   ##
=========================================
+ Coverage   100.0%   100.0%   +0.1%     
=========================================
  Files         265      266      +1     
  Lines       21936    21959     +23     
=========================================
+ Hits        21930    21953     +23     
  Misses          6        6             
Impacted Files Coverage Δ
...lml/tests/model_understanding_tests/test_graphs.py 100.0% <ø> (ø)
...del_understanding_tests/test_partial_dependence.py 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4306f6...d3a487c. Read the comment docs.

@chukarsten
chukarsten force-pushed the 1835-2way_partial_dependence_plots branch from ec12a57 to 5154054 Compare March 4, 2021 21:41
@chukarsten
chukarsten merged commit 30a8295 into main Mar 9, 2021
@chukarsten
chukarsten deleted the 1835-2way_partial_dependence_plots branch March 9, 2021 00:46
@dsherry dsherry mentioned this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants