interpretml/DiCE
Generate Diverse Counterfactual Explanations for any machine learning model. observed · 2026-08-28
Health v2 · maintenance only
37/100
- Activity 31
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 2680
- days_rel: 416
- days_push: 416
- n_releases_24m: 1
Adoption not part of the score
1525 stars · 235 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
DiCE is a Python library that generates diverse counterfactual explanations for any machine learning model, showing feature-perturbed versions of an input that would flip the model's decision. It supports model-agnostic methods (random sampling, genetic search, KD-tree) as well as gradient-based methods for TensorFlow and PyTorch models.
Use cases
- explain why a loan application was rejected and what would change the outcome
- generate counterfactual examples for a scikit-learn classifier
- produce what-if explanations for a deep learning model
- audit model decisions in finance or healthcare with actionable explanations
- generate diverse counterfactuals for a black-box ML model
- complement SHAP or LIME explanations with counterfactuals
When to choose
- you need actionable 'what-if' explanations for model predictions
- you want model-agnostic counterfactual generation across sklearn, TensorFlow, or PyTorch models
- you need multiple diverse counterfactuals rather than a single nearest example
- you are doing explainable AI research or building XAI pipelines in Python
When to avoid
- you need feature-importance or attribution explanations rather than counterfactuals
- you work outside Python or need a GUI-based explanation tool
- your model is a simple linear model where counterfactuals add little value
- you need real-time explanations with strict latency constraints
Facets
library · maturity active
machine-learning nlp machine-learning artificial-intelligence data-science python counterfactual-explanations explainable-ai xai interpretable-ml model-agnostic what-if-explanations
4 sources
- readme: https://github.com/interpretml/DiCE · fetched 2026-08-28 · 2210293cf887
- homepage: https://interpretml.github.io/DiCE/ · fetched 2026-08-29 · 0c8cb07d8ba5
- site_page: http://interpret.ml/DiCE/readme.html · fetched 2026-08-29 · 1986bc6c04f5
- site_page: http://interpret.ml/DiCE/notebooks/DiCE_model_agnostic_CFs.html · fetched 2026-08-29 · 3561e6380a19
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| interpretml/DiCE | main | 37 |
For agents
markdown · JSON · MCP: product_card(name="interpretml/DiCE")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem