Skip to content

Explainer: What Is a Counterfactual Explanation? (And How It Differs From Counterfactual Fairness) #296

Description

@yakew7

Add explainers/counterfactual-explanation.md.

Counterfactual Fairness already exists, but it's a fairness definition (Kusner et al. 2017: would this person's outcome differ if they'd been born into a different demographic group?). Counterfactual explanation is a different, older concept from the explainability literature (Wachter et al. 2017): given one specific denied/flagged decision, what is the smallest change to this person's inputs that would have flipped it? It's the third major explainability paradigm alongside feature-attribution methods (SHAP - already covered, LIME - tracked in #282) and is the basis for real 'adverse action' notices in credit/lending. The shared word 'counterfactual' is a genuine, common point of confusion worth an explainer calling out directly.

Suggested structure (match shap-values.md): one-sentence definition -> explicitly distinguish from Counterfactual Fairness -> why it matters for fairness (actionable recourse, adverse-action notices) -> core concept -> concrete example tied to a repo audit -> runnable detection code (e.g. the dice-ml package or a minimal from-scratch nearest-counterfactual search) -> limitations (multiple valid counterfactuals, unrealistic/non-actionable suggestions) -> related concepts/projects/further reading.

Related: counterfactual-fairness, shap-values, protected-attribute.

See CONTRIBUTING.md: add explainers/<slug>.md plus a one-line entry in assets/explainers-data.json; the build script generates the page.

Freeze-safe: explainers are fully open for contribution during the paper freeze. If you quote any Fair Code benchmark result, use the frozen numbers in paper/results-frozen/ (never re-run your own) - see CLAUDE.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationhelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions