Skip to main content

Uncertainty-Aware Bias Auditing Framework for ML models on small datasets

Project description

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

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

uabaf-0.2.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uabaf-0.2.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file uabaf-0.2.0.tar.gz.

File metadata

  • Download URL: uabaf-0.2.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.7

File hashes

Hashes for uabaf-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cde6c64ee77008826721fa926a1da12bae6e09215af9a55046605c4809adc5d8
MD5 0b7f87efd79c39fe8143bbde7072fb55
BLAKE2b-256 db4bd4396a4813da3793b2d0f2563951dd123227f7bd8973b3316868b1d6055b

See more details on using hashes here.

File details

Details for the file uabaf-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: uabaf-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.7

File hashes

Hashes for uabaf-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d0000b6b463406d15a52a9108ee57b7cc0318a4880756fe68324281da3680e2
MD5 b70806a3a4dddd5fb354c9c0be61dd25
BLAKE2b-256 b1eeebe5d989a8571384799ac5ab67c89cc4d3c28b80cac669c17af06af295c0

See more details on using hashes here.

Supported by

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