This repository provides source code for the Alien Nutri-Solver Framework (A web-based game framework) utilised to conduct the user studies as follows:
Detailed motivation and rationale are explained in the corresponding papers. In short, we provide this framework as a utility to run user studies to perform human level evaluations of counterfactual explanations for machine learning models.
Implementation of the experimental framework follows a clear separation into python-based BackEnd, and a javascript based FronEnd.
Very well! Let's go:
There is a list of steps that first need to be done on the BackEnd side before we can go to the Alien Zoo.
- Whatever you do, use Python3.
cd BackEnd- Install all requirements as listed in
REQUIREMENTS.txt. - Install [
dice_ml] (Note: required Python 3.6 or higher!):pip install dice_ml - Setup an MySQL database (databse name, user name and password of your choice). Then, make sure the credentials and database in
dbmgr.py(lines 6-10) fit your set up. - Run
python crypt.py(generates key pair; relevant for encrypting userId information). - Decide which experiment from our study you want to recreate. The default is Experiment 1, but you can change that via the variable
expNoin line 17 in fileBackEnd/models.py.
Finally, we can start the server: python server.py
The server is listening on port 8888, so pull up a browser and go to the Alien Fitness Hub under localhost:8080/.
When you're done, stop the running server with Ctrl+C.
Run BackEnd/db_export.py to export data from the database. This command generates 6 files from the content of the database. For details on these files and coding of respective data, see here.
Finally, when you are done with the code, run
python BackEnd/reset_database.py user_name user_pw
to reset the database again.
Fair enough: The port can be changed in line 15 in file BackEnd/server.py.
This work is licensed under a Creative Commons Attribution 4.0 International License.
