Skip to main content

Equipy is a tool for fast, online fairness calibration

Project description

Build yes

EquiPy is a Python package implementing sequential fairness on the predicted outputs of Machine Learning models, when dealing with multiple sensitive attributes. This post-processing method progressively achieve fairness accross a set of sensitive features by leveraging multi-marginal Wasserstein barycenters, which extends the standard notion of Strong Demographic Parity to the case with multiple sensitive characteristics. This approach seamlessly extends to approximate fairness, enveloping a framework accommodating the trade-off between performance and unfairness.

The project was started in 2023 by François Hu, Philipp Ratz, Suzie Grondin, Agathe Fernandes Machado and Arthur Charpentier, following the release of this paper “A Sequentially Fair Mechanism for Multiple Sensitive Attributes” (https://arxiv.org/pdf/2309.06627.pdf), written by François Hu, Philipp Ratz and Arthur Charpentier.

For additional details, you can visit the dedicated EquiPy website https://equilibration.github.io/equipy/.

Installation

Dependencies

EquiPy requires:

  • Numpy (>= 1.17.3)

  • Scipy (>= 1.5.0)

  • Scikit-learn (== 1.3.0)

  • Matplotlib (== 3.7.2)

  • Pandas (== 2.0.3)

  • Statsmodels (== 0.14.0)

  • Seaborn (== 0.12.2)

  • POT (==0.9.1)

User installation

To install EquiPy, use pip:

pip install equipy

Project Tree Structure

The following is the tree structure of the project:

equipy/
    ├── equipy/
    |   ├── __init__.py
    |   ├── fairness/
    |   │   ├── __init__.py
    |   |   ├── _base.py
    |   |   ├── _wasserstein.py
    |   ├── graphs/
    |   │   ├── __init__.py
    |   │   ├── _arrow_plot.py
    |   │   ├── _density_plot.py
    |   │   ├── _waterfall_plot.py
    |   ├── metrics/
    |   │   ├── __init__.py
    |   │   ├── _fairness_metrics.py
    |   │   ├── _performance_metrics.py
    |   ├── utils/
    |   │   ├── __init__.py
    |   │   ├── checkers.py
    |   │   ├── permutations/
    |   │   |   ├── __init__.py
    |   │   |   ├── _compute_permutations.py
    |   │   |   ├── metrics/
    |   │   |   |   ├── __init__.py
    |   │   |   |   ├── _fairness_permutations.py
    |   │   |   |   ├── _performance_permutations.py
    ├── .gitignore
    ├── LICENSE
    ├── README.rst
    ├── requirements.txt
    ├── setup.py
    └── tests.py

Visualization

This package contains the module graphs which allows visualization of the resulting sequential fairness applied to a response variable.

pic1 pic2

(Risk, Unfairness) phase diagrams that show the sequential fairness approach for (left pane) two sensitive features; (right pane) three sensitive features.

pic3 pic4

A sequential unfairness evaluation, for (left pane) exact fairness in $A_{3}$ ; (right pane) approximate fairness in $A_{3}$ with $\epsilon = (\epsilon_{1}, \epsilon_{2}, \epsilon_{3}) = (0.2, 0.5, 0.75)$. Hashed color corresponds to exact fairness.

Help and Support

Communication

If you have any inquiries, feel free to contact us:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

equipy-0.0.11a0.dev0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

equipy-0.0.11a0.dev0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file equipy-0.0.11a0.dev0.tar.gz.

File metadata

  • Download URL: equipy-0.0.11a0.dev0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for equipy-0.0.11a0.dev0.tar.gz
Algorithm Hash digest
SHA256 748477bdaec0530d95f8c38a6424b4d3bb8d0706c394d389f6cd213c75b01059
MD5 0dd8891a6d7163abc266adaa5a78c83e
BLAKE2b-256 f05556b1a44ec000438a02db264846cf96101a6829403ed02e2eca2ac615fce1

See more details on using hashes here.

File details

Details for the file equipy-0.0.11a0.dev0-py3-none-any.whl.

File metadata

  • Download URL: equipy-0.0.11a0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for equipy-0.0.11a0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9affe9426f5e0f9dc45d8bb8e0ce4e61a08390c52ec94d6f7d26cfe7c3d52ed
MD5 c8411591d66d9e51fa214a7b2ff664dd
BLAKE2b-256 f6f775e3fca58297a92fd307c4a4c7152af16ee8994b1e4d87ceed43f9eef416

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page