_PACKAGE UNDER 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.6.tar.gz
(16.8 kB
view hashes)
Built Distribution
equal_odds-0.0.6-py3-none-any.whl
(17.5 kB
view hashes)
Close
Hashes for equal_odds-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be7d664925c6a74610f4d98faa127a0585d0605c940171b0df4224972d7bc91 |
|
MD5 | abcc26aa34d833656184e623497729d4 |
|
BLAKE2b-256 | 0d3f446bdb5999f630fd91f786134fdc3cce190f6c0f3e0525c86e69b1237f0c |