This is a repository for the XAI (Explainable AI) exercise.
The exercise consists of training a machine learning model to classify handwritten digits from the MNIST dataset, and then creating a web application to visualize and explain the model's predictions using SHAP (SHapley Additive exPlanations).
The repository contains the following files:
cfel.py
: Python class containing the code to compute the counterfactuals of the model.LSM.py
: Python script containing the code for the LocalSurrogateModels.process.py
: sample to encode various types of data.vizualization.py
: script that provide the shap values.main.py
: script that contains a sample of using entire flow.data.csv
: generated data for testing purposes.
To run the code, you need to have the following libraries installed:
- pandas
- numpy
- matplotlib
- shap
- scikit-learn
python3 -m venv venv
source venv/bin/activate
pip install -r Requirements.txt
python main.py
deactivate