Implement CounterPlots to DiCE CF generation#377
Implement CounterPlots to DiCE CF generation#377rmazzine wants to merge 3 commits intointerpretml:mainfrom ADMAntwerp:main
Conversation
This commit adds the CounterPlots package to the DiCE CF generation package. Basically, the `CounterfactualExplanations` object was changed to now include a new method `generate_counterplots` which takes factual, counterfactual, and DataFrame info to generate the counterfactual analysis. Also, this object now asks for a prediction function, therefore, the `explainer_base`, `dice_tensorflow1`, and `dice_tensorflow2` now include this function to create the object.
|
dice_counterplots_example_notebook.zip The zip above has a Jupyter Notebook that shows how counterplots work with DiCE. |
|
Very soon I will make the necessary modifications in the unitary tests. |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #377 +/- ##
==========================================
- Coverage 68.33% 66.83% -1.51%
==========================================
Files 27 27
Lines 3610 3639 +29
==========================================
- Hits 2467 2432 -35
- Misses 1143 1207 +64
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
|
@rmazzine Thanks for starting this PR. Will you be able to look at the unit tests and make sure that they pass? Apologies that I missed responding to this earlier. |
Signed-off-by: Raphael Mazzine, PhD <43969088+rmazzine@users.noreply.github.com>
|
I will close this PR because I've made a better (and easier) solution in PR #402 |
Dear DiCE developing team,
This PR adds to DiCE a novel way to represent counterfactual explanations. The current DiCE only shows the explanations as a list of parameters, and we know the importance of having more graphically appealing representations, especially when creating explanations.
Therefore, we've developed a new package to generate metrics and charts that augment the informative value of counterfactual explanations, CounterPlots (https://github.com/ADMAntwerp/CounterPlots), the preprint article with full information can be found in this link: https://arxiv.org/abs/2306.06506
I also have made a Medium blog post with a more summarized review of the methods: https://mazzine.medium.com/measuring-counterfactual-explanations-feature-importance-with-counterplots-41359bc85aea
We hope this new package can be useful to you and we are open for your comments and suggestions, below I made a more technical description of the changes made in this PR.
This commit adds the CounterPlots package to the DiCE CF generation package. Basically, the
CounterfactualExplanationsobject was changed to now include a new methodgenerate_counterplotswhich takes factual, counterfactual, and DataFrame info to generate the counterfactual analysis. Also, this object now asks for a prediction function, therefore, theexplainer_base,dice_tensorflow1, anddice_tensorflow2now include this function to create the object.Best wishes,