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.1.0

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.1.0
File Size Uploaded Provenance Actions
mitigateyourbias-0.1.0.tar.gz 52.1 kB With provenance Details for mitigateyourbias-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 88.2 kB

Release files / mitigateyourbias-0.1.0.tar.gz

Download URL mitigateyourbias-0.1.0.tar.gz
Size 52.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d1c2a79adb3c111db08714fed2600d34101eee11c0ff3bcb0d9a181768327769
BLAKE2b-256 checksum
How to use checksums
35fa777cad47dfc1b47967b9adaaf86457d8eb15de8d967fe13eb611c50676e2
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.1.0-py3-none-any.whl

Download URL mitigateyourbias-0.1.0-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
764f80d6c4136d7a74b380722c55b8b5d30744f36b4fb1d4a51cbdad163716d3
BLAKE2b-256 checksum
How to use checksums
598dfd3f5f32c681cfbb53c993c9c5b1fafa7fc304471f8d65df71e738c4abb7
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.1.0

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.1.0.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.1.0 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