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.2.tar.gz (16.2 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.2-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cp_based_fair_maker-0.0.2.tar.gz
  • Upload date:
  • Size: 16.2 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.2.tar.gz
Algorithm Hash digest
SHA256 caa72a4a69c50db0243c99422c126a5bb58f68ae54e259b28adc66e964776de9
MD5 09af8f819109c5bc7ba6ca5f7640f4ff
BLAKE2b-256 0897f05b5a540802f5a7b7732fe1d67341b5f0945ebcbf6c13c7d1184e825dfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cp_based_fair_maker-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a94a7bd031e7d0ac3b1178774d4948c122f76afbe18b1020cd77734b22289f53
MD5 73ff58b7ea0ef0c01a94b7e12573ed11
BLAKE2b-256 3f98c6cb74c1141970a2f571269f49a40e84fbc6712b0633cf71de8c4d27d09d

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