Skip to main content

A library for detecting and mitigating bias in machine learning models, with a focus on interoperability with scikit-learn, Pandas, and PyTorch.

Project description

FairLib - Python Library for Fairness Metrics and Processing

This library provides a set of tools for measuring and improving fairness in machine learning models, covering a variety of fairness metrics, pre-processing, in-processing, and post-processing techniques.

Complete Workflow Example Notebook

Library functionality

The library will provide some fairness metrics to perform various analyses. Plus a number of pre-processing, in-processing and post-processing algorithms.

Fairness Metrics

Pre-Processing Techniques

In-Processing Techniques

Project Structure

Overview of the project structure:

<root directory>
├── fairlib/               # Main package for the project   ├── __init__.py        # Package marker   ├── metrics/           # Fairness metrics implementations   ├── preprocessing/     # Pre-processing techniques for fairness   └── inprocessing/      # In-processing debiasing algorithms
├── tests/                 # Unit tests for the library   ├── metrics/           # Unit tests for fairness metrics   ├── preprocessing/     # Unit tests for pre-processing methods   └── inprocessing/      # Unit tests for in-processing techniques
├── examples/             # Jupyter notebooks with examples
├── .github/               # GitHub workflows for CI/CD   └── workflows/
│       ├── test.yml       # Run tests on multiple Python versions       └── deploy.yml     # Deploy to PyPI if tests succeed
├── pyproject.toml         # Project configuration file managed by Poetry
├── LICENSE                # License file (Apache 2.0 by default)
├── README.md              # Project documentation (this file)
├── renovate.json          # Configuration of Renovate bot, for automatic dependency updates
├── requirements.txt       # Only declares a dependency on Poetry. DO NOT EDIT THIS FILE
└── release.config.js      # Script to release on PyPi, and GitHub via semantic-release

Restore dev dependencies

  1. Install Poetry if you don't have it yet
pip install -r requirements.txt
  1. Install the project's dependencies
poetry install

Run unit tests

poetry run poe test

Tests are automatically run in CI, on all pushes on all branches. There, tests are executed on multiple OS (Win, Mac, Ubuntu) and on multiple Python versions.

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

aequitas_fairlib-2.8.1.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

aequitas_fairlib-2.8.1-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file aequitas_fairlib-2.8.1.tar.gz.

File metadata

  • Download URL: aequitas_fairlib-2.8.1.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for aequitas_fairlib-2.8.1.tar.gz
Algorithm Hash digest
SHA256 1744da6051894c0b4f7a89d669ce3c8ef3b9118f430b97fc25a6780aaa7dd6e6
MD5 728df58f7bb3c56a0b2aac7f7be402a3
BLAKE2b-256 8ca478c4b6f26846de9e5bd0ec473419edf0298b117597c148dbcda1728cda45

See more details on using hashes here.

File details

Details for the file aequitas_fairlib-2.8.1-py3-none-any.whl.

File metadata

  • Download URL: aequitas_fairlib-2.8.1-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for aequitas_fairlib-2.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed32984daf5a1729470fe31a3f823194f4f08c148f78d26b5e226416b36c9f4f
MD5 90e1d81d01e3db17ab6a9ef1bc893b45
BLAKE2b-256 ed5470e4d24bcca56da7b93b51aa851f30baf23ff1f9c8493cd90db189dee84a

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