To replicate our experiment in the paper, please go to this repository.
@underreview{
}
git clone https://github.com/trustablefox/quickstart_example.git
cd quickstart_example
Then, open the DEMO.ipynb file for a concrete example.
pip3 install foxplainer
from foxplainer.explainer import FoX
fx = FoX(global_model_name="LR",
xnum='all',
global_model_path="./global_model/openstack_LR_global_model.pkl",
proj_name="openstack",
data_path="./dataset/",
inst_id=5)
fx.explain(in_jupyter=False)
A user needs to provide the following parameters:
-
global_model_name: should be either "RF" (Random Forest) or "LR" (Logistic Regression)
-
xtype (optional): Only needed when xnum=1. Support two types of explanations, specify "abd" for Abductive Explanation or "con" for Contrastive Explanation
-
xnum: should be either 1 or "all" (return all explanations)
-
global_model_path: the path to your trained global model (model should be trained using sci-kit learn library)
-
proj_name: the project name of your dataset
-
data_path: the path to the required data, this path should contain the following 2 files:
6.a {proj_name}.csv - the complete file consisting of all training + testing data with features and label
6.b {proj_name}_X_test.csv - the testing data that only contains feature columns without label
-
inst_id: the row number of the instance to be explained in your testing data
pip3 install -r requirements.txt
pip3 install foxplainer
conda install -c conda-forge foxplainer
git clone https://github.com/trustablefox/foxplainer.git
poetry install
If you do not have poetry installed yet, simply run the command below to install it, for more information, click here.
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
We welcome and recognize all contributions. You can see a list of current contributors in the contributors tab.
Access our official documentation here.