The project proposes a new XAI (eXplainable Artificial Intelligence) tool to analyse and explain model using aSHAP (aggregated SHapley Additive exPlanations) to describe a set of observations at once.
This repository contains codes for football xG (eXpected Goals) model analysis with aSHAP. The project was created during summer internship at MI2 DataLab.
TO RUN ONLY THE APP SCROLL DOWN
- To install
R
andPython
, you have to run a script from the project's main directory:
./create_environment_scripts/install_R_Python
- To install all the necessary libraries and to create
Python
virtual environment, you have to run a script from the project's main directory:
./create_environment_scripts/create_environment
- To open
jupyterlab
, run in a command line from the project's main directory:
source ./virtualenv/bin/activate
jupyter lab
- Remember that some notebooks are written in
R
and some are inPython
; remember to choose a proper kernel in a notebook. Information about notebook's language is always on the top of the notebook.
DALEX
package in R
was extended with aSHAP
implementation during summer internship ().
This project relies on the same implementation, but here the functions are available in a script, not as a part of DALEX
package.
You can use shiny
app to explore results for different tasks. The app will create waterfall plots for both: aSHAP for a chosen task and SHAP for a chosen observation in a chosen task.
To install all libraries needed by the app, run in a command line from the project's main directory:
Rscript ./init.R
To run the app, run in a command line from the project's main directory:
Rscript ./run.R
By default, the app shows results from ./results
directory. If you want to change the directory, set the results_dir
variable in ./shiny_app/utils.R
file to a path of your desired directory.