-
Java JDK/JRE 11. Make sure Java JDK/JRE 11 has been installed. FairML has only been tested on OpenJDK 11.0.13 2021-10-19 and can be downloaded from https://adoptopenjdk.net/.
-
Install Microsoft Visual Studio Build Desktop Development with C++ 2019. Download Visual Studio Community 2022 setup/installer from Download Visual Studio Tools - Install Free for Windows, Mac, Linux. Choose to install Microsoft Visual Studio Build Desktop Development with C++. This will also install Visual Studio Build Tools 2019.
-
Install Anaconda. Download and install Anaconda from https://www.anaconda.com/products/individual.
-
Python dependencies. Install all the following Python dependencies.
pip install jupyter scipy numpy sklearn pandas tensorflow matplotlib aif360 shap fairlearn p2j adversarial-robustness-toolbox BlackBoxAuditing cvxpy numba
-
Install Maven. Follow there instruction here Maven – Installing Apache Maven.
-
Donwload the FairML project. Download from Github.
git clone https://github.com/York-and-Maastricht-Data-Science-Group/fairml.git
-
Build fairml.jar. Follow the instructions below to build the file using Maven.
cd fairml\generator\org.eclipse.epsilon.fairml.generator mvn install
You will find fairml.jar file created.
-
Inside the fairml\generator\org.eclipse.epsilon.fairml.generator directory, you will can find automated_selection.flexmi file. The file represents FairML model in *.flexmi extension expressed in YAML language. You can also find fairml.bat. The file is a helper file to generate Bias Mitigation code in Python and Jupyter Notebook files in Windows.
-
execute the following command to generate the files.
fairml.bat automated_selection.flexmi
The command will produce four files:
automated_selection.flexmi.xmi automated_selection.ipynb automated_selection.py fairml.py
-
Run Jupyter Notebook.
>> jupyter notebook
-
Open the automated_selection.ipynb in Jupyter Notebook and run the whole notebook.
-
If you find errors while running it, there might be modules that haven't been installed yet. Install the modules using the 'pip' command.
-
Java JDK/JRE 11. Make sure Java JDK/JRE 11 has been installed. FairML has only been tested on OpenJDK 11.0.13 2021-10-19. It can be installed using this command.
sudo apt-get install openjdk-11-jdk openjdk-11-jre
-
Install Python 3, pip, and Maven. Execute the commands below to install python3, pip, and maven.
sudo apt update
sudo apt install python3 python3-pip maven
- Python dependencies. Install all the following dependencies. If it doesn't work, replace the 'pip3' with 'pip'. Ubuntu uses pip3 for Python 3 and pip for Python 2, but it depends on the settings of your local machine.
sudo pip3 install numba jupyter scipy numpy sklearn pandas tensorflow matplotlib aif360 shap fairlearn p2j adversarial-robustness-toolbox BlackBoxAuditing cvxpy numba
- Download the FairML project. Download from Github.
git clone https://github.com/York-and-Maastricht-Data-Science-Group/fairml.git
- Build fairml.jar. Follow the instructions below to build the file using Maven.
cd fairml/generator/org.eclipse.epsilon.fairml.generator
mvn install
You will find fairml.jar file created. Or if you are using Eclipse, right click on the project, click Run As
and then click Maven install
.
-
Inside the fairml\generator\org.eclipse.epsilon.fairml.generator directory, you can find automated_selection.flexmi file. The file represents FairML model in *.flexmi extension expressed in YAML language. You can also find fairml.sh. The file is a helper file to generate Bias Mitigation code in Python and Jupyter Notebook files in Ubuntu.
-
Set the fairml.sh file to be executable, and execute the command to generate the files.
sudo chmod +x fairml.sh ./fairml.sh automated_selection.flexmi
The command will produce four files:
automated_selection.flexmi.xmi automated_selection.ipynb automated_selection.py fairml.py
-
Run Jupyter Notebook.
>> jupyter notebook
-
Open the automated_selection.ipynb in Jupyter Notebook and run the whole notebook.
-
If you find errors while running it, there might be modules that haven't been installed yet. Install the modules using the 'pip3' or 'pip' command.