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.2.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.2-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aequitas_fairlib-2.8.2.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.2.tar.gz
Algorithm Hash digest
SHA256 26aa0f41825eeeba1a42de230029b05065fd5443b32bf280a06a31755a2f00e6
MD5 7b0830283192b7924c0c753f1ad93957
BLAKE2b-256 042fdab01912780c792aea6def1c9ae965ba09446aa8af11507a0c9b3fc85e6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aequitas_fairlib-2.8.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 46adc32adbf34935c9e1f36e69588ad6968cf8bb5df7c25b29552b5a81023d8b
MD5 ac829e1b3b2b50741c50554245441dbe
BLAKE2b-256 85439dd26956079901fa30e7482d2b31f1fc7719bd7caf784d063d49f5744d60

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