interpretml / DiCE

Generate Diverse Counterfactual Explanations for any machine learning model.
https://interpretml.github.io/DiCE/
MIT License
1.33k stars 185 forks source link

DiCE genetic question #133

Open martheveldhuis opened 3 years ago

martheveldhuis commented 3 years ago

You have based DiCE genetic on GeCo if I understand correctly. Is there a way to 'group' features as they define in their paper; "The first statement says that education and income are correlated: GeCo will consider only counterfactual values that occur together in the data." So for instance if we have feature A and B, make sure that the algorithm always generates counterfactuals for which the combination of A=a and B=b exists in the training data.

soundarya98 commented 3 years ago

Dice genetic currently has two methods of initialization: kdtree, random

  1. kdtree: If the initialization is set to kdtree, DiCE genetic picks the k (k is the number of counterfactuals desired by the user) closest points in the training set to the query instance.

    • If k points from the training set satisfy other user-given constraints such as permitted_range, features_to_vary, the returned k counterfactuals are from the training set. Since the algorithm would pick points within the training set, this method would ensure that correlations in the training data are taken care of.
    • Suppose only k' counterfactuals from the training dataset satisfy permitted_range, features_to_vary, where k' < k. In this case, we return k-k' valid counterfactuals that satisfy constraints by sampling randomly from the range of each feature. Since the algorithm would generate points outside the training set, this method wouldn't necessarily ensure that correlations in the training data are taken care of for the remaining k-k' points.
  2. random: If the initialization is set to random, DiCE generates valid counterfactuals that satisfy constraints by sampling randomly from the range of each feature. Since the algorithm would generate points outside the training set, this method wouldn't necessarily ensure that correlations in the training data are taken care of.

prateeky2806 commented 3 years ago

@soundarya98, thanks for the nice explanation. I had a slightly different question, I am not able to figure out which is the method used in the paper. I am trying to reproduce the results but having a hard time understand the configuration that is being used in the original paper. It would be great if you can provide some clarity on that. Thanks,