Fairness metrics for continuous risk scores
Project description
Fair-Scoring
Fairness metrics for continuous risk scores.
The implemented algorithms are described in the paper [1].
Project Links
Documentation | PyPI | Paper
Quickstart
Installation
Install with pip
directly:
pip install fair-scoring
Example Usage
The following example shows how compute the equal opportunity bias of the compas dataset
import pandas as pd
from fairscoring.metrics import bias_metric_eo
# Load compas data
dataURL = 'https://raw.githubusercontent.com/propublica/compas-analysis/master/compas-scores-two-years.csv'
df = pd.read_csv(dataURL)
# Relevant data
scores = df['decile_score']
target = df['two_year_recid']
attribute = df['race']
# Compute the bias
bias = bias_metric_eo(scores, target, attribute, groups=['African-American', 'Caucasian'], favorable_target=0,
prefer_high_scores=False)
Further examples
Further examples - especially the experiments conducted for the publication - can be found in the documentation.
Development
Setup
Clone the repository and install from this source via
pip install -e .[dev]
Tests
To execute the tests install the package in development mode (see above)
pytest
Following the pytest framework, tests for each package are located in a subpackages named test
Docs
To build the docs move to the ./docs
subfolder and call
make clean
make html
References
[1] Becker, A.-K. and Dumitrasc, O. and Broelemann, K.; Standardized Interpretable Fairness Measures for Continuous Risk Scores; Proceedings of the 41th International Conference on Machine Learning, 2024; pdf
Bibtex
@inproceedings{Becker2024FairScoring,
author = {Ann{-}Kristin Becker and Oana Dumitrasc and Klaus Broelemann}
title = {Standardized Interpretable Fairness Measures for Continuous Risk Scores},
booktitle={Proceedings of the 41th International Conference on Machine Learning},
year = {2024}
}
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
Built Distribution
File details
Details for the file fair_scoring-0.2.0.tar.gz
.
File metadata
- Download URL: fair_scoring-0.2.0.tar.gz
- Upload date:
- Size: 395.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f2852929b6aa4cbf581068c70703aa00481c515365b5a462b75b2a73216d0e7 |
|
MD5 | 3f35d3a518eca0b0bcdc742573ff5594 |
|
BLAKE2b-256 | 0284657e304b1e1ac741b48cf40c103173b9da10e9f644fe1b613a78707d4aa0 |
File details
Details for the file fair_scoring-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: fair_scoring-0.2.0-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6315ba311b53e3d4fdc8811019094917a19e2e720a88ca96cbd6c94c96d0bb6 |
|
MD5 | f6e6e3c98e07aa1ed7c588564ceb684f |
|
BLAKE2b-256 | d51d6db1f5b70bf395ba832a3942e9f63dc4b33e9cbda95a9c6b4e0c44092a14 |