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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aequitas_fairlib-2.7.8.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.6-2-MANJARO

File hashes

Hashes for aequitas_fairlib-2.7.8.tar.gz
Algorithm Hash digest
SHA256 89430698f1d835db1bd1672a496c8765258190f82d330c57107afea9762e4782
MD5 badecac82cdff60c13b3177205f4d2d4
BLAKE2b-256 9ea8c3a227a8eef7c2c19f6e83ab520df015675a5f4bf66bef525451b20b5f64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aequitas_fairlib-2.7.8-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.13.3 Linux/6.14.6-2-MANJARO

File hashes

Hashes for aequitas_fairlib-2.7.8-py3-none-any.whl
Algorithm Hash digest
SHA256 09f062f5bf585453234acfa10a2ba6924ad77e8df59baee57e804994b5ecc361
MD5 3daba5b610c6d59866022dfe761d7bf9
BLAKE2b-256 e8e7c4b7f64e8feb3c9a824f31d9bccbc5438f8a527c2872be72e86eb393233f

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