DTExtract is a tool for extracting model explanations in the form of decision trees. More precisely, given
- blackbox access to a model (i.e., for a given input, produce the corresponding output),
- a sampling distribution over the input space,
then DTExtract constructs a decision tree approximating that model.
The work on instant local interpretations of blackbox models is under dev-tree-interpreter branch, not in master branch. Please refer there, to see the code and experiments on instant local interpretations of blackbox models. Samples of the work that are available in the experiments section in that branch:
- Prerequisites
- Setting Up DTExtract
- Using DTExtract
DTExtract has been tested using Python 3.7. DTExtract depends on numpy, scipy, scikit-learn, and pandas.
Run setup.sh
to set up the datasets used in the examples that come with DTExtract.
See python/dtextract/examples/iris.py
for an example using a dataset from the UCI machine learning repository with the goal of classifying Iris flowers. The dataset is located at data/iris.zip
(download link). To run this example, run
$ cd python
$ python -m dtextract.examples.iris
Similarly, see python/dtextract/examples/diabetes.py
for an example using a diabetes readmissions dataset. The dataset is located at data/dataset_diabetes.zip
(download link). To run this example, run
$ cd python
$ python -m dtextract.examples.diabetes
Finally, see python/dtextract/examples/wine.py
for an example using a dataset from the UCI machine learning repository with the goal of classifying wines. The dataset is located at data/wine.zip
(download link). To run this example, run
$ cd python
$ python -m dtextract.examples.wine