Skip to main content

🔍 FairCheck

Fairness for AI, made simple.

Tests License: MIT Python 3.8+ Code style: black Status: Alpha GitHub stars

Audit, measure, and mitigate demographic bias in your AI models with one line of code.


What is FairCheck?

FairCheck is an open-source Python library that makes fairness analysis in machine learning simple, accessible, and actionable. Whether you're a researcher, ML engineer, or AI ethics practitioner, FairCheck helps you understand how your models perform across demographic groups.

Why FairCheck?

Modern AI systems often exhibit demographic biases that are invisible in aggregate metrics. A model with 95% accuracy might perform dramatically worse for certain groups. FairCheck makes detecting and mitigating these biases as easy as one function call.

from faircheck import audit

results = audit(
    model=your_model,
    dataset=your_data,
    sensitive_attrs=['gender', 'race', 'age']
)

results.report()  # Beautiful interactive dashboard

That's it. No more 100-line scripts. No more custom analysis pipelines.

Key Features

  • One-line auditing - Comprehensive fairness analysis in a single function call
  • Multiple metrics - Demographic parity, equalized odds, TPR/FPR disparity, calibration, and more
  • Framework agnostic - Works with PyTorch, TensorFlow, Scikit-learn, and Hugging Face models
  • Beautiful reports - Interactive HTML dashboards, PDF exports, and JSON outputs
  • Bias mitigation - State-of-the-art techniques to reduce bias in trained models
  • Continuous monitoring - Track fairness in production over time
  • Research-grade - Implements peer-reviewed methods from leading fairness research

Installation

Note: FairCheck is currently in active development. The PyPI release is coming soon!

# Coming soon
pip install faircheck

# Development version
git clone https://github.com/kasra-kakavand/faircheck.git
cd faircheck
pip install -e .

Quick Start

Basic Audit

import faircheck as fc

# Audit any classifier in one line
results = fc.audit(
    model=my_model,
    dataset=test_data,
    sensitive_attrs=['gender']
)

# View results
print(results.summary())

# Generate detailed report
results.report(output='fairness_report.html')

Bias Mitigation

from faircheck import mitigate

# Apply variance-based fairness regularization
fair_model = mitigate(
    model=biased_model,
    method='variance_regularization',
    train_data=training_data,
    sensitive_attr='skin_tone'
)

Continuous Monitoring

from faircheck import FairnessMonitor

# Set up production monitoring
monitor = FairnessMonitor(model=production_model)

# Track predictions over time
monitor.track(predictions, demographics)

# Get alerts when fairness drifts
if monitor.detect_drift():
    monitor.alert("Fairness threshold violated")

Supported Metrics

FairCheck implements a comprehensive suite of fairness metrics:

Category Metrics
Group Performance Accuracy, TPR, FPR, TNR, FNR per group
Disparity Measures Demographic parity, equalized odds, equal opportunity
Statistical Disparate impact ratio, statistical parity difference
Calibration Calibration error per group, ECE disparity
Custom Variance-based regularization, intersectional metrics

Why This Matters

"Fairness in AI is not a feature—it's a requirement."

As AI systems are deployed in healthcare, hiring, criminal justice, and finance, ensuring equitable treatment across demographic groups is critical. FairCheck democratizes fairness analysis, making it accessible to every ML practitioner.

Roadmap

  • Project foundation
  • Core fairness metrics module
  • PyTorch integration
  • Interactive HTML reports
  • PyPI release (v0.1.0)
  • TensorFlow integration
  • Bias mitigation algorithms
  • LLM fairness analysis
  • Production monitoring tools
  • Hugging Face Hub integration
  • Comprehensive documentation site

Contributing

We welcome contributions! FairCheck is built by the community, for the community. Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.

# Fork the repo, then:
git clone https://github.com/YOUR_USERNAME/faircheck.git
cd faircheck
pip install -e ".[dev]"
pytest

Citation

If you use FairCheck in your research, please cite:

@software{kakavand2026faircheck,
  title={FairCheck: A Library for Fairness Auditing in Machine Learning},
  author={Kakavand, Kasra},
  year={2026},
  url={https://github.com/kasra-kakavand/faircheck}
}

License

FairCheck is released under the MIT License. See LICENSE for details.

Author

Kasra Kakavand

Acknowledgments

FairCheck builds on decades of research in algorithmic fairness. Special thanks to the contributors of fairness research and the open-source ML community.


Built with care for a fairer AI future.

If you find FairCheck useful, please consider giving it a star ⭐

Metadata

Release files for faircheck 0.1.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 faircheck 0.1.0
File Size Uploaded
faircheck-0.1.0.tar.gz 15.7 kB Details

Built distribution (wheel)

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

Total release size: 27.7 kB

Release files / faircheck-0.1.0.tar.gz

Download URL faircheck-0.1.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4ed5e566cdf6f42d41ba5e185c8033e70ff04fb1ade35f45a9c70a81316c12d4
BLAKE2b-256 checksum
How to use checksums
1a86d5cc6663d5f18fc0d4ba05ddfb89e816d0f6e71e6c074cd324b7f82cd71a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / faircheck-0.1.0-py3-none-any.whl

Download URL faircheck-0.1.0-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
205ecda78dddbb06188d8b51d8676b023b65f4bf0aed243bd4744fdb0218a86e
BLAKE2b-256 checksum
How to use checksums
8eb9d5deec9e5ffb764dcbf03a1b1792038a2b85857047d84e5d898f5a316d32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release history Release notifications | RSS feed

This release

0.1.0 This release

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