Skip to main content

A library that provides metrics and algorithms for bias assessment in datasets using CP-based methods

Project description

cp-based-fair-maker

Description

This is a library for creating fair ML datasets using Constraint Programming (CP). It suggests a way to create fair datasets by solving a constraint satisfaction problem (CSP) using CP and various fairness metrics. The library is based on the Google OR-Tools CP solver.

Glossary

  1. Protected attribute: An attribute/feature that divides the population into groups that we want to be fair to. For example, race or gender can be protected attributes.
  2. Privileged group: Considering a protected attribute, the groups that have historically been advantaged or have had more opportunities.
  3. Unprivileged group: Considering a protected attribute, the groups that have historically been disadvantaged or have had fewer opportunities.
  4. Instance: A row in the dataset.
  5. Feature: A column in the dataset.
  6. Instance weight: A weight assigned to each instance in the dataset. It can be seen as the number of times an instance is repeated in the dataset.
  7. Label column: The column that represents the class labels of the instances.
  8. Score columns: Columns that represent the confidence scores of the instances for each class label.
  9. Fairness metric: A metric that measures the fairness of the dataset.
  10. Fairness threshold: A threshold value for a fairness metric. The fairness metric value is compared to this threshold to determine if the dataset is fair or not.

Install from source

If you want to install the package from the source code, you can clone the repository and install it using pip:

pip install build setuptools wheel
python -m build
pip install dist/cp_based_fair_maker-<version>.whl

Here <version> should be replaced with the actual version number of the package.

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

cp_based_fair_maker-0.0.3.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

cp_based_fair_maker-0.0.3-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file cp_based_fair_maker-0.0.3.tar.gz.

File metadata

  • Download URL: cp_based_fair_maker-0.0.3.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for cp_based_fair_maker-0.0.3.tar.gz
Algorithm Hash digest
SHA256 83f97e93b46b1a5fa448aa1a8e32d0dfcde0873505137fef8afce1f0e325f93a
MD5 994a7285428e632430dbaece156a6eea
BLAKE2b-256 41dbd33e1615ff88f4abdc739f7f21118a995f7eb1424162520e251082ed17d5

See more details on using hashes here.

File details

Details for the file cp_based_fair_maker-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for cp_based_fair_maker-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e2e4c4ef0f535dba0bfe86f2409db1240de7c16d12015747121ed735e49c62e1
MD5 b5699d737d87522cf7c732711363e2c3
BLAKE2b-256 faee3ce0ca86c77ee8e21607de07097c6923046bcb99d1cbf5bdf550151c0872

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