This repository provides a fully automated toolkit to help students evaluate and mitigate bias in machine learning datasets and models. The toolkit includes scripts and a Streamlit app that work with the COMPAS and StereoSet datasets.
fairness_script_loader.py: Loads and summarizes the dataset with fairness-related statistics.baseline_model_trainer.py: Trains a baseline logistic regression model and reports performance/fairness metrics.fairness_intervention.py: Applies fairness interventions (upsampling, downsampling, or reweighting) and retrains the model.reflection_and_hypotheses.py: Generates a structured reflection template based on student configuration.fairness_app.py: An interactive Streamlit web app to explore, model, and evaluate fairness metrics.
-
Clone or fork the repository
git clone https://github.com/berrygrant/Fairness_App.git -
Install requirements (preferably in a virtual environment):
pip install -r requirements.txt
-
Launch the Streamlit app on your local machine:
streamlit run fairness_app.py
Alternatively, you can access the deployed app: https://fairness-in-ai-activity.streamlit.app/
Note: Streamlit's free tier has limited memory resources, so the app may crash. I've set a cron job that will reboot the app every morning, but I will not reboot the app on an ad-hoc basis.