Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Add get_feature_contributions method to Pipeline - #186

Closed
najeeb-kazmi wants to merge 32 commits into
microsoft:masterfrom
najeeb-kazmi:91
Closed

Add get_feature_contributions method to Pipeline#186
najeeb-kazmi wants to merge 32 commits into
microsoft:masterfrom
najeeb-kazmi:91

Conversation

@najeeb-kazmi

@najeeb-kazmi najeeb-kazmi commented Jul 12, 2019

Copy link
Copy Markdown
Member

Fix #91

Adds a get_feature_contributions() method to Pipeline, which works similarly to predict() but adds a transforms_featurecontributioncalculationtransformer node after the transforms_datasetscorer node in the graph that gets executed.

Adds a get_feature_contributions() method to BasePredictor so that models trained outside of a Pipeline also return feature contributions.

Adds an example of how to use this.

Adds a test to check that an unpickled model can calculate feature contributions.

Adds a test to check that a model loaded from zip can calculate feature contributions.

@najeeb-kazmi
najeeb-kazmi requested a review from ganik July 12, 2019 20:26
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/pipeline.py
@najeeb-kazmi najeeb-kazmi changed the title Add calculate_feature_contributions method to Pipeline Add get_feature_contributions method to Pipeline Jul 15, 2019
Comment thread src/python/nimbusml/base_predictor.py
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/pipeline.py Outdated
Comment thread src/python/nimbusml/tests/pipeline/test_load_save.py Outdated
* Save the model file when pickling a NimbusML Pipeline.

* Add version to the pickled Pipeline.

* Add the steps attribute to a pickled Pipeline instance.

* Add extra unit test for pickled nimbusml pipelines.

* Add export_version to pickled base_pipeline_items.
Remove unnecessary export_version attribute from an unpickled Pipeline.
Comment thread src/python/nimbusml/base_predictor.py
"Restore a pickled object."
for k, v in state.items():
if k not in {'modelbytes', 'type'}:
if k not in {'modelbytes', 'type', 'export_version'}:

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.

can u rebase ? this change should be in master already

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did, but the commit history in this branch got screwed up while fixing conflicts. This (and other changes) aren't actually in this PR.

@najeeb-kazmi

Copy link
Copy Markdown
Member Author

Closing this and replacing with PR #196

@najeeb-kazmi
najeeb-kazmi deleted the 91 branch October 9, 2019 21:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explanability - Enable Feature Contribution Calculator (FCC)

3 participants