Implement CounterPlots to DiCE CF generation #377
Closed
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.
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
CounterfactualExplanations
object was changed to now include a new methodgenerate_counterplots
which 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_tensorflow2
now include this function to create the object.Best wishes,