Skip to main content

UABAF — Uncertainty-Aware Bias Auditing Framework

A Python package for auditing fairness in machine learning models trained on small datasets, using BCa bootstrap confidence intervals to communicate uncertainty alongside fairness metric point estimates.


The problem it solves

Standard fairness toolkits (AIF360, Fairlearn) report point estimates only:

Demographic Parity Difference: 0.12  ← FAIL

On small datasets, that number could easily shift from 0.08 to 0.16 with a different random seed. UABAF adds a confidence interval and an uncertainty-aware verdict:

Demographic Parity Difference: 0.12  CI: [0.04, 0.21]  ⚠️  FAIL — Low Confidence

Installation

# Core package
pip install uabaf

# With AIF360 + Fairlearn comparison support
pip install uabaf[compare]

# For development
pip install uabaf[dev]

Note: UABAF pins numpy<2 because AIF360 requires it.


Quick start

from uabaf import AuditReport

# model  — any sklearn-compatible fitted classifier
# X_test — feature matrix (numpy array or DataFrame)
# y_test — true labels
# s_test — sensitive attribute vector (binary: 0=unprivileged, 1=privileged)

report = AuditReport(model, X_test, y_test, sensitive=s_test)
report.summary()   # prints Stage 1 + Stage 3 verdict table
report.plot()      # BCa CI interval plots for all metrics

Fairness metrics

Key Metric Threshold
dpd Demographic Parity Difference |dpd| ≤ 0.10
eod Equalized Odds Difference |eod| ≤ 0.10
eop Equal Opportunity Difference |eop| ≤ 0.10
di Disparate Impact Ratio 0.80 – 1.20

Verdict categories

Verdict Meaning
✅ PASS — High Confidence Metric within threshold, narrow CI
⚠️ PASS — Low Confidence Metric within threshold but wide CI — collect more data
❌ FAIL — High Confidence Metric breaches threshold, narrow CI
🔍 FAIL — Low Confidence Metric breaches threshold but wide CI — inconclusive

Research context

UABAF was developed as part of an M.Tech thesis at the University of Buea, Department of Computer Engineering, under the supervision of Dr. Nyanga Bernard Y.


License

MIT

Release files for uabaf 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uabaf 0.2.0
File Size Uploaded
uabaf-0.2.0.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uabaf 0.2.0
File Interpreter ABI Platform
uabaf-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.2 kB

Release files / uabaf-0.2.0.tar.gz

Download URL uabaf-0.2.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cde6c64ee77008826721fa926a1da12bae6e09215af9a55046605c4809adc5d8
BLAKE2b-256 checksum
How to use checksums
db4bd4396a4813da3793b2d0f2563951dd123227f7bd8973b3316868b1d6055b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.7

Release files / uabaf-0.2.0-py3-none-any.whl

Download URL uabaf-0.2.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d0000b6b463406d15a52a9108ee57b7cc0318a4880756fe68324281da3680e2
BLAKE2b-256 checksum
How to use checksums
b1eeebe5d989a8571384799ac5ab67c89cc4d3c28b80cac669c17af06af295c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page