Skip to main content

MIT license PyPI Discord StackOverflow

Fairlearn

Fairlearn is a Python package that empowers developers of artificial intelligence (AI) systems to assess their system’s fairness and mitigate any observed unfairness issues. Fairlearn contains mitigation algorithms as well as metrics for model assessment. Besides the source code, this repository also contains Jupyter notebooks with examples of Fairlearn usage.

Website: https://fairlearn.org/

What we mean by fairness

An AI system can behave unfairly for a variety of reasons. In Fairlearn, we define whether an AI system is behaving unfairly in terms of its impact on people – i.e., in terms of harms. We focus on two kinds of harms:

  • Allocation harms. These harms can occur when AI systems extend or withhold opportunities, resources, or information. Some of the key applications are in hiring, school admissions, and lending.

  • Quality-of-service harms. Quality of service refers to whether a system works as well for one person as it does for another, even if no opportunities, resources, or information are extended or withheld.

We follow the approach known as group fairness, which asks: Which groups of individuals are at risk for experiencing harms? The relevant groups need to be specified by the data scientist and are application specific.

Group fairness is formalized by a set of constraints, which require that some aspect (or aspects) of the AI system’s behavior be comparable across the groups. The Fairlearn package enables assessment and mitigation of unfairness under several common definitions. To learn more about our definitions of fairness, please visit our user guide on Fairness of AI Systems.

Note: Fairness is fundamentally a sociotechnical challenge. Many aspects of fairness, such as justice and due process, are not captured by quantitative fairness metrics. Furthermore, there are many quantitative fairness metrics which cannot all be satisfied simultaneously. Our goal is to enable humans to assess different mitigation strategies and then make trade-offs appropriate to their scenario.

Overview of Fairlearn

The Fairlearn Python package has two components:

  • Metrics for assessing which groups are negatively impacted by a model, and for comparing multiple models in terms of various fairness and accuracy metrics.

  • Algorithms for mitigating unfairness in a variety of AI tasks and along a variety of fairness definitions.

Fairlearn metrics

Check out our in-depth guide on the Fairlearn metrics.

Fairlearn algorithms

For an overview of our algorithms please refer to our website.

Getting Started with Fairlearn

First steps

For Users & Practitioners

For Contributors

Maintainers

A list of current maintainers is on our website.

Code of conduct

Fairlearn follows the Fairlearn Organization’s Code of Conduct.

Issues

Regular (non-security) issues

Issues are meant for bugs, feature requests, and documentation improvements. Please submit a report through GitHub issues. A maintainer will respond promptly as appropriate.

Maintainers will try to link duplicate issues when possible.

Reporting security issues

To report security issues please send an email to fairlearn-internal@python.org.

Metadata

Release files for fairlearn 0.15.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 fairlearn 0.15.0
File Size Uploaded
fairlearn-0.15.0.tar.gz 109.9 kB Details

Built distribution (wheel)

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

Total release size: 251.3 kB

Release files / fairlearn-0.15.0.tar.gz

Download URL fairlearn-0.15.0.tar.gz
Size 109.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dfdfbddc3b86d2a8e4e04e282bb29d7603f28559a28abeca97847bf5e0f79f80
BLAKE2b-256 checksum
How to use checksums
4ef8d1ef45777b36ff973bfc06bd33a30c568a6275466193f2a121919dd82106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fairlearn-0.15.0-py3-none-any.whl

Download URL fairlearn-0.15.0-py3-none-any.whl
Size 141.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f4656c25af384fc3369db719231680c4e83beb2e6e075e5dc3c2b27d06455c9
BLAKE2b-256 checksum
How to use checksums
889de96346594f66e8933181b286cdf8b495bd71998ccbc7ae3ee5e33efa0cde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14
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