_PACKAGE IN CONSTRUCTION_
Project description
equal-odds
This repository is under construction :construction:
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.2.tar.gz
(15.9 kB
view details)
Built Distribution
File details
Details for the file equal-odds-0.0.2.tar.gz
.
File metadata
- Download URL: equal-odds-0.0.2.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 104c66de5eb771eb1ae6a011f92e73375b7c2383f328c3828f288b2026bb33d0 |
|
MD5 | 7d8fefd4d8c56d54652dbfec063023a7 |
|
BLAKE2b-256 | ab90c90fc2212dd562141866280ba90f23ea92d1b099299fa257aa85ffd74708 |
File details
Details for the file equal_odds-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: equal_odds-0.0.2-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81c697e380906a3e381b07f11cc0c83eae4f7b7c06c54c1103adea222e85ca7e |
|
MD5 | 5e18c8432f6af79e013d7a1973b0588d |
|
BLAKE2b-256 | 6d8bf60c305b36914c217a25b5f5061d4ef68162185abc6ae6251914cf0f2b20 |