Explaining Machine Learning Classifiers through Diverse Counterfactual Explanations | Mothilal, Sharma, Tan

TODO: read the actual paper, see Mothilal2019.

Source code.

These are quick notes from a presentation of this paper.

Desirable properties of counterfactuals

Counterfactuals answer contrastive questions: Why P rather than Q? Why am I denied this loan? Instead of saying that e.g. the income was important for denying a loan, a user wants to know what to change for the outcome to be different. That is, a main desirable property of counterfactuals is that they should be actionable.

Actionability: users should be able to make the changes indicated by counterfactuals.

This paper then discusses what requirements must be satisfied for actionable counterfactuals.

  • Firstly, when are counterfactuals feasible?
    • Proximity: CF example should be as close as possible to current instance
    • User constraints: the user may specify that certain features can't be changed
    • Sparsity: change as little features as possible for a significant shift in target label
    • Causal constraints: instance feature are typically not independent and counterfactual explanations that have unrealistic or impossible feature combinations are not human-friendly. E.g. do not produce an instance with age 2 but a very high education level.
  • Secondly, (main contribution of this paper), users should be offer diverse explanations so that they can choose the one that is most appropriate for them

The well-known paper of Wachter et al. (2017) focuses on proximity only. Russell 2017 does pay attention to diversity, but only for linear models.

The authors of this paper propose a loss function (i.e. a general optimization framework to find counterfactuals) which combines your typical loss w.r.t. target label with a distance matrix to ensure proximity and loss term to stimulate diversity. The method produces k diverse counterfactuals at once, which makes total sense because the diversity term can only be defined on a group of counterfactuals.

Practical considerations

The DiCE library has additional features:

  • Additional feasibility properties
    • Post-hoc correction for more sparse counterfactuals
    • User constraints
  • Other loss functions, e.g. with hinge loss
  • Separate distance functions for categorical and continuous distance functions
  • Scaling of mixed features

Quantitative evaluation framework

Authors claim that so far all evaluation was qualitative. They think quantitative benchmarking is very useful.

  • Comparison metrics (they are, according to the authors, not the same as the loss metrics used for generating the counterfactuals)
    • Validity
    • Proximity
    • Sparsity
    • Diversity
  • Can the diverse counterfactuals be used to approximate the local decision boundary of the ML model?
    • Not sure I fully see get the use case here, but they suggest that counterfactuals can then be used by users to eyeball model predictions

Results

  • DiCE is the only method that produces more diverse counterfactuals, but this is at the cost of reduced proximity for larger sets of CFs
  • Still higher diversity and proximity w.r.t. baseline of Wachter et al 2017.
  • With <= 10 CFs, the approximation of the local decision boundary is already as good as LIME (which uses 5000 samples) on the adult income dataset than F1.