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.4.tar.gz (17.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.4-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cp_based_fair_maker-0.0.4.tar.gz
  • Upload date:
  • Size: 17.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.4.tar.gz
Algorithm Hash digest
SHA256 f9fe39cb7b2ef14175f6a55ab759c7d1c6a03f4cbd97720427e934fc3745ee04
MD5 cd055dde3c708e1411ac1f66196fe29f
BLAKE2b-256 04c29d88445791ebb4597dde2f2672cd92be37333a4fac2ed92aafe76d4e50b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cp_based_fair_maker-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8cb26cdba24801f4ae19fda7233ae124019d971cc21849f25b010c96396bf245
MD5 47da703b6de972ded52187fe2a82ba63
BLAKE2b-256 7d0673297af2b218dc799448b85b4be0daf0a945ccb86a4926ef11629609d2f6

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