Skip to main content

MitigateYourBias

PyPI CI License Python

Find bias in model decisions, reduce it, and get a short evidence report for the EU AI Act.

Objective

Fairness libraries tell you a number. Auditors ask for a document. We built this to close that gap: point it at a table of decisions and a few protected columns, and it measures the gaps, applies a simple fix, and writes down what changed and which AI Act article each result speaks to.

Install

pip install MitigateYourBias

Python 3.10 or newer.

Try it in 30 seconds

mitigate-your-bias demo      # hiring example, prints before and after, writes ./mitigate_report/
mitigate-your-bias app       # opens the Streamlit app at http://localhost:8501

The demo output looks like this:

Fairness criterion : demographic_parity
Mitigation         : reweighing (preprocessing), Kamiran & Calders 2012, KAIS
Accuracy           : 0.76 -> 0.7545 (change -0.0055)
  * demographic_parity_difference     0.1615 -> 0.1036  (change -0.0579)
    disparate_impact_ratio            0.4848 -> 0.6085  (change +0.1237)

The gap shrinks a lot, and it is still slightly above the 0.1 limit. We left that in on purpose. A mitigation helps, it does not promise a pass.

What you get

Four commands: demo runs a built-in example (hiring_screening or travel_assistant), run does the same on your own CSV, app starts the Streamlit app, and explain writes a plain-language summary of a report.

For your own data: mitigate-your-bias run --input decisions.csv --label y_true --sensitive sex,age_group. Add --pred y_pred if the CSV already has your model's predictions. Otherwise it trains a small logistic regression on the numeric columns.

The app has four tabs. Demo runs an example. Your data loads a CSV and shows outcome rates per group. Mitigate applies the fix to that data. Evidence and explain shows the report, lets you download it, and can summarise it in plain words.

It does not train your production model, handle images or text, or tell you whether your system is legal. It checks group fairness on tabular decisions, and it picks one method per run: reweighing for demographic parity, per-group thresholds for equal opportunity.

Optional: plain-language explanations

explain and --explain use an Azure OpenAI deployment of gpt-4.1-mini. Copy .env.example to .env and set AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_VERSION and MODEL_DEPLOYMENT_NAME. Only the metrics are sent, never the rows of your data. Without these settings the tool prints a short note and carries on.

EU AI Act, in one paragraph

Article 10 asks providers of high-risk systems to examine their data for bias and to deal with it. Article 15 asks for accurate, dependable systems, including consistent performance across groups. The evidence report lists each metric with its definition, threshold, result and the article it supports, plus the fairness criterion chosen and why, the before and after values, a data hash and a timestamp. It supports your compliance work and is not legal advice.

Development

git clone git@github.com:AmadeusITGroup/MitigateYourBias.git
cd MitigateYourBias
pip install -e ".[dev]"
pytest -q

License and authors

Apache-2.0, see LICENSE. Written by Ilias Driouich and Hongliu Cao at Amadeus.

Metadata

Release files for MitigateYourBias 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MitigateYourBias 0.2.1
File Size Uploaded Provenance Actions
mitigateyourbias-0.2.1.tar.gz 52.2 kB With provenance Details for mitigateyourbias-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for MitigateYourBias 0.2.1
File Interpreter ABI Platform Actions
mitigateyourbias-0.2.1-py3-none-any.whl Python 3 none any Details for mitigateyourbias-0.2.1-py3-none-any.whl

Total release size: 88.2 kB

Release files / mitigateyourbias-0.2.1.tar.gz

Download URL mitigateyourbias-0.2.1.tar.gz
Size 52.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9dae82490aa8b0aab9bfaec885e8fce68d85a40bc03a7fdaaa70ef7ee38d3559
BLAKE2b-256 checksum
How to use checksums
e19a9d1760fbf935f6bb7e1af05df7d269a144e9d4b626f70e34101b852769d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / mitigateyourbias-0.2.1-py3-none-any.whl

Download URL mitigateyourbias-0.2.1-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f73894f200287bddd88a137e989bf2b5cbec26c29e200c42d5888937ec0659b
BLAKE2b-256 checksum
How to use checksums
ad6f45f9d5110d1c1196909f1ca42d498be17aa1811afbe3e8418a5a37685766
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for MitigateYourBias 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mitigateyourbias-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page