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.1.tar.gz (17.6 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.1-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cp_based_fair_maker-0.0.1.tar.gz
  • Upload date:
  • Size: 17.6 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.1.tar.gz
Algorithm Hash digest
SHA256 54301da2c6faf0f8349854fe03d82e39760d194995fb57631586a5182f8eb4de
MD5 13cdd1f18feb47dcc3fbc278b0f1138f
BLAKE2b-256 79d9309f0aa2750c53d027d17b8c77942436522ee6d695ece1a7e61bf56da7ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cp_based_fair_maker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a67379cab89b38eaa6f8f439fdd1809888b56eb60f412f1a77cf0ebbd1aab52
MD5 a4be3363ae567a8d230edc113f39018b
BLAKE2b-256 74d3d9618059476157c300c5e51767234b61d61d80ebe956a8947a26babcb680

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