Skip to main content

_PACKAGE UNDER CONSTRUCTION_

Project description

equal-odds

This repository is under construction :construction:

PyPI publishing status PyPI version OSI license Python compatibility

A fast adjust

Installing

Install package from PyPI:

pip install equal-odds

Or, for development, you can clone the repo and install from local sources:

git clone https://github.com/AndreFCruz/equal-odds.git
pip install ./equal-odds

Getting started

# Given any trained model that outputs real-valued scores
fair_clf = RelaxedEqualOdds(
    predictor=lambda X: model.predict_proba(X)[:, -1],   # for sklearn API
    # predictor=model,  # use this for a callable model
    tolerance=0.05,     # fairness constraint tolerance
)

# Fit the fairness adjustment on some data
# This will find the optimal _fair classifier_
fair_clf.fit(X=X, y=y, group=group)

# Now you can use `fair_clf` as any other classifier
# You have to provide group information to compute fair predictions
y_pred_test = fair_clf(X=X_test, group=group_test)

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

equal-odds-0.0.5.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

equal_odds-0.0.5-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file equal-odds-0.0.5.tar.gz.

File metadata

  • Download URL: equal-odds-0.0.5.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for equal-odds-0.0.5.tar.gz
Algorithm Hash digest
SHA256 25fc33e88d3c1e26cf3c6c245bd87f3fe86d6cffeeb870faaa1de672a946f9ed
MD5 fce47a883e02c07694fb6cd1f8406740
BLAKE2b-256 b94751b87ff0469850ed7862d7ec520e475b82e3567d7269ca18c8e129ef3471

See more details on using hashes here.

File details

Details for the file equal_odds-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: equal_odds-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for equal_odds-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 092e871ec2e0875a952a61a3d434344f24f88a3d85dc3bf8b154b72f66358191
MD5 fa3eeecdf6697364c6a3caa00af38eb5
BLAKE2b-256 95c0b126305f9c3afc7691b2e9cc9f28e0609a0e1271db46bd759e546da9991b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page