# Supplementary Material for Paper #8921

## Contents

This archive contains:

- proofs.pdf: a .pdf file containing the proofs of all the propositions given in the paper
- explainingDT-neurips21-heat-maps.pdf: some additional examples of heatmaps and sufficient reasons for mnist49 and mnist38 datasets
- Several programs that can be launched in order to test our scripts and reproduce our results (see below)
- All datasets used in the experiments (in the directory "dataset")
- results.xlsx: a spreadsheet that contains the empirical results collected for all datasets

- the "results" tab corresponds to an extension of Table 1 (as given in the paper) to the 90 datasets considered in the experiments. A couple of additional columns have also been added (#Instances is the number of instances of the dataset, #Features gives the number of features used primarily for describing the instances, #Classes is the number of classes, and depth is the mean depth of the decision trees that have been generated)
- the "time" tab focuses on the computation time required to get the number of sufficient reasons (#Sufficient) of an instance using d4, and to enumerate its minimal sufficient reasons up to 10 000 (#Minimal). The median time, the maximum run time and the number of instances for which the computation did not terminate in due time (for the sufficient reasons) or led to generate 10 000 minimal sufficient reasons (#failed) are reported.

- The directory bin that contains the runtime codes of the softwares Muser (MUS computation) and d4 (model counter)

## Software

You need to have a Linux OS in order to run the scripts. First of all, create a conda environment: open a terminal in the right directory and type: `conda env create --file environment.yml`. Then, activate this environment: `conda activate paper8921`

#### mnist.py

This script generates and displays a heatmap, two sufficient reasons, and relevant/necessary literals for the mnist instances. By default, you have 8 or 3, you can change and generate 4 and 9 by modifying line 28 of this script. To run it, please enter the following command `python3 mnist.py`

#### test_DT.py

This script generates some examples for a given dataset. For 10 instances, it computes and displays a sufficient reason, a maximum number of 1000 minimal sufficient reasons, the necessary and relevant literals, a maximum number of 10 000 sufficient reasons, and the explanatory importance of literals. To run it, please enter the following command: `python3 test_DT.py dataset/compas.csv` (the dataset is selected as an argument of the script).

#### generate_data_DT.py

This script allows to generate results following a 10-fold cross validation process, as explained in the experimental section of the paper. To run the script, please enter the following command `python3 generate_data_DT.py dataset/compas.csv` (the dataset is selected as an argument of the script). The results are saved in a .json file to be found in the folder "json" (this folder is empty at start but it must exist for the script to run smoothly).

#### Other scripts

The script my_tree.py contains the algorithms presented in the paper and used to derive sufficient reasons, to derive minimal sufficient reasons, to compute necessary and relevant features, etc.

The script coding_CNF.py contains several encodings of cardinality constraints into the CNF format.

####