--- id: fairlearn version: "0.14.0" license: unclear license_treatment: permissive maintenance: active --- # fairlearn — A Python package to assess and improve fairness of machine learning models. License: permissive · Maintenance: active · Downloads: 209.3K/mo ## What it is and what it does Fairlearn is a Python package for assessing and mitigating fairness in AI systems, focusing on harms that occur when models treat different groups of people unequally. It operationalizes fairness through a group fairness approach, asking which groups are at risk for experiencing harms—either allocation harms (when opportunities or resources are withheld) or quality-of-service harms (when a system works differently for different people). The package provides two main components: metrics for identifying which groups are negatively impacted by a model and comparing models across fairness and accuracy trade-offs, and mitigation algorithms that reduce unfairness across various AI tasks and fairness definitions. The package depends on standard data science libraries (numpy, pandas, scikit-learn, scipy) and narwhals, and supports Python 3.10 through 3.13. It is actively maintained with a release history dating back to 2018, and the repository shows recent activity. The package acknowledges that fairness is fundamentally a sociotechnical challenge—quantitative metrics alone cannot capture all aspects like justice or due process, and not all fairness metrics can be satisfied simultaneously. Its role is to enable practitioners to assess different mitigation strategies and make trade-offs appropriate to their specific scenario. Use it for: - Assess hiring or lending models to detect whether they systematically disadvantage protected groups before deployment - Measure and compare fairness metrics across multiple candidate models to inform model selection decisions - Apply post-processing mitigation algorithms to adjust model predictions to satisfy fairness constraints like demographic parity - Evaluate quality-of-service fairness to ensure a recommendation or classification system works equally well across demographic groups - Generate fairness reports for stakeholders to document which groups experience harms and what trade-offs were made ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Fairlearn assesses and mitigates fairness issues in machine learning models by providing metrics to identify which groups are negatively impacted and algorithms to reduce unfairness across various AI tasks. Yes. Fairlearn is actively maintained, has low install friction, carries a permissive license, and addresses a real need in responsible AI development. It is appropriate for teams building production ML systems that must account for fairness across demographic groups. The package is mature enough for practical use (Alpha status reflects ongoing development, not instability) and has substantial adoption. Install it if fairness assessment or mitigation is part of your model development workflow. ## Install pip install fairlearn uv add fairlearn poetry add fairlearn ## Installing fairlearn Before you install: Low install friction with a pure Python wheel and five well-established dependencies (numpy, pandas, scikit-learn, scipy, narwhals). Active maintenance with a release 68 days ago and ongoing repository activity. License in practice: Permissive license allows unrestricted use, modification, and distribution in commercial and private projects without copyleft obligations. Quickstart: pip install fairlearn from fairlearn.metrics import MetricFrame from fairlearn.postprocessing import ThresholdOptimizer import pandas as pd # Assess fairness across groups metric_frame = MetricFrame(metrics={...}, y_true=y, y_pred=y_pred, groups=groups) # Mitigate unfairness mitigator = ThresholdOptimizer(estimator=model, constraints='demographic_parity') mitigator.fit(X_train, y_train, sensitive_features=sensitive_train) Verify before relying: - Whether narwhals is used as a dataframe abstraction layer or for a specific feature - Specific fairness constraint types and mitigation algorithms available beyond the description - Performance characteristics when applied to large datasets or high-dimensional sensitive features ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 209.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags machine learning fairness assessment, bias detection and mitigation, group fairness metrics, algorithmic fairness tools, model fairness evaluation, AI bias mitigation, fairness constraints for ML, fairness-bias, model-evaluation, responsible-ai [View on SkillFed](https://skillfed.io/packages/fairlearn) · [View on PyPI](https://pypi.org/project/fairlearn/)