Business User Guide
A comprehensive guide for AI Product Managers, Compliance Officers, and Business Stakeholders responsible for ensuring fair and ethical AI systems.
This guide is designed for professionals who need to understand AI fairness without deep technical implementation details. For code examples and API documentation, see the Developer Documentation.
Library Structure
vfairness is organized into eight modules following the ML fairness pipeline:
Business value: Catches bias at the source — in the data — rather than trying to fix it later.
Business value: Produces inherently fairer models without post-hoc corrections.
Business value: Improves fairness on existing models without retraining, enabling rapid remediation.
Business value: Gives quantitative evidence of fairness for auditors, regulators, and stakeholders.
Business value: Ensures models stay fair in production — not just at deployment time.
Business value: Produces audit-ready documentation and executive summaries with one command.
Business value: Enables evidence-based decisions about which fairness interventions actually work.
Business value: Makes fairness a routine part of software delivery, not an afterthought.
Document Overview
This guide covers:
- Business Context: Why fairness matters for your organization
- Regulatory Requirements: Current and emerging compliance landscape
- Core Concepts: Fairness definitions explained in plain language
- Practical Application: How to use vfairness in your workflow
- Decision Framework: Choosing appropriate metrics and thresholds
- Reporting & Dashboards: Privacy-aware metrics, progressive-disclosure dashboards, automated reports
- Experimentation: Fairness-aware A/B testing, power analysis, and multi-objective optimization
Why AI Fairness Matters
Algorithmic fairness has become a critical concern for organizations deploying AI systems. The consequences of unfair AI extend across legal, reputational, ethical, and operational dimensions.
The Business Case for Fairness
AI fairness is not merely an ethical aspiration — it is a strategic business imperative with measurable impact on revenue, risk, talent, and market positioning. Organizations that proactively address fairness gain a durable competitive advantage, while those that ignore it face compounding costs across multiple dimensions.
Legal & Regulatory Risk
Discriminatory AI systems expose organizations to lawsuits, regulatory fines, and enforcement actions. The EU AI Act imposes penalties of up to 6% of global annual turnover (or €35 million, whichever is higher) for non-compliant high-risk AI systems. In the US, the EEOC, CFPB, and FTC have all signaled increased enforcement against algorithmic discrimination. NYC Local Law 144 already mandates annual bias audits for automated employment decision tools, and similar legislation is advancing in California, Colorado, Illinois, and at the federal level.
Class-action lawsuits targeting algorithmic bias are growing: settlements in lending, hiring, and insurance discrimination cases have reached hundreds of millions of dollars. Regulatory investigations are costly even when they do not result in fines — legal fees, remediation costs, and management distraction extract significant value. The cost of proactive fairness testing is a fraction of the cost of reactive compliance.
Reputational Damage
Public exposure of biased AI systems causes lasting brand damage that is difficult and expensive to repair. High-profile cases at major tech companies — from biased facial recognition to discriminatory credit algorithms — demonstrate that no organization is immune from scrutiny. A single investigative report or viral social media post can erode years of brand equity overnight.
Research from the Edelman Trust Barometer shows that 81% of consumers say trust in a brand is a deciding factor in purchasing decisions, and trust erosion from AI bias incidents can take years to recover from. In B2B contexts, enterprise procurement teams increasingly require AI ethics documentation and fairness audit evidence as part of vendor due diligence. Organizations without demonstrable fairness practices risk losing contracts to competitors who can provide them.
Ethical Responsibility
Organizations have a duty to ensure their systems do not perpetuate historical discrimination or create new forms of harm to protected groups. AI systems trained on historical data often encode decades of systemic inequities — from redlining in lending to gender bias in hiring. Without deliberate intervention, these systems amplify and automate discrimination at unprecedented scale and speed.
The ethical imperative extends beyond avoiding harm. Organizations shape societal outcomes through the AI systems they deploy: a fairer hiring algorithm creates more equitable employment opportunities; a fairer lending model expands financial access for underserved communities; a fairer healthcare algorithm ensures treatment recommendations reflect actual clinical need. With this power comes a responsibility to act as stewards of equitable outcomes, particularly for historically marginalized populations who bear a disproportionate burden of algorithmic harm.
Operational Excellence
Fair models often perform better across diverse populations, improving overall accuracy and business outcomes while reducing customer complaints. When a model underperforms for specific demographic groups, it also underperforms for the business — missed opportunities, incorrect decisions, and reduced customer satisfaction compound over time.
Fairness-aware development practices also improve general model quality: bias auditing surfaces data quality issues, calibration analysis reveals prediction errors, and subgroup evaluation uncovers hidden failure modes. Organizations that integrate fairness into their ML pipeline report fewer production incidents, more robust model performance, and better generalization to new market segments. The discipline of fairness engineering — rigorous data evaluation, systematic testing, and continuous monitoring — raises the quality bar for the entire AI development lifecycle.
Market Access & Revenue Growth
Fair AI systems unlock revenue in underserved markets. Models that perform poorly for certain demographics leave money on the table — creditworthy borrowers denied loans, qualified candidates screened out, and engaged customers served irrelevant recommendations. A McKinsey analysis found that closing racial gaps in areas like homeownership, wages, and education could add $5 trillion to US GDP over five years. Organizations whose AI systems equitably serve diverse populations are better positioned to capture these market opportunities.
In regulated industries (financial services, healthcare, insurance), demonstrable fairness is increasingly a market access requirement. Organizations that cannot evidence fair AI practices face barriers to entering new jurisdictions (particularly in the EU under the AI Act), obtaining regulatory approvals, and winning government contracts. Conversely, organizations with mature fairness practices gain first-mover advantage in these markets.
Investor & Stakeholder Expectations
ESG (Environmental, Social, and Governance) criteria have become central to investment decisions, and responsible AI is a core component of the "S" and "G" pillars. Major institutional investors, including BlackRock, State Street, and Norges Bank, have explicitly incorporated AI ethics into their governance expectations. Companies that face AI bias incidents see measurable stock price declines: research shows an average of 1.5–3% shareholder value loss following public disclosure of discriminatory AI practices.
Beyond institutional investors, regulators and stock exchanges increasingly expect disclosure of AI governance practices. The EU's Corporate Sustainability Reporting Directive (CSRD) and the SEC's expanding disclosure requirements signal that AI fairness will become a standard reporting obligation. Organizations that build robust fairness frameworks now will be better prepared for these evolving disclosure requirements.
Talent Attraction & Retention
Top AI and engineering talent increasingly evaluates employers on their ethical AI practices. Surveys consistently show that over 70% of data scientists and ML engineers consider a company's stance on responsible AI when choosing where to work. Organizations known for deploying biased systems face difficulties recruiting and retaining talent, particularly among underrepresented groups who are most sensitive to these issues.
Internal AI ethics programs also improve employee engagement and reduce turnover among existing teams. Engineers who feel empowered to raise fairness concerns and see those concerns addressed constructively are more productive and loyal. Conversely, organizations that dismiss fairness concerns or pressure teams to deploy known-biased systems risk "ethics washing" backlash, public whistleblowing, and the departure of their most principled — and often most talented — practitioners.
Customer Trust & Loyalty
Consumer awareness of algorithmic bias is rising sharply. A Pew Research study found that over 60% of Americans believe AI is used in ways that treat people unfairly based on race, gender, or other characteristics. As public understanding grows, customers increasingly seek out organizations that can demonstrate transparent and fair AI practices. This is particularly acute in high-stakes decisions like lending, insurance, healthcare, and hiring, where individuals are directly affected by algorithmic outcomes.
Organizations that proactively communicate their fairness practices — through transparency reports, model cards, and accessible bias audit results — build deeper trust with customers. This trust translates into measurable business outcomes: higher customer acquisition rates, lower churn, greater willingness to share data, and stronger Net Promoter Scores. In an era of declining institutional trust, demonstrable AI fairness is a powerful differentiator.
The costs of ignoring AI fairness compound over time. A biased model deployed today generates discriminatory decisions that accumulate into legal exposure, erode brand trust, and alienate both customers and employees. Each day of inaction increases the remediation burden: retraining models, correcting past decisions, compensating affected individuals, and rebuilding trust. The most cost-effective time to address fairness is at the design stage — before biased systems reach production. Organizations that embed fairness into their AI development lifecycle from the outset avoid the exponential costs of retroactive correction.
Real-World Impact
Algorithmic bias has been documented across numerous domains:
| Domain | Example | Impact |
|---|---|---|
| Healthcare | Risk prediction algorithm (Obermeyer et al., 2019) | Black patients had to be 25% sicker to receive same care level |
| Criminal Justice | COMPAS recidivism prediction | Black defendants falsely flagged as high-risk at 2x rate |
| Employment | Resume screening algorithms | Systematic downranking of candidates with ethnic-sounding names |
| Lending | Mortgage approval algorithms | Higher rejection rates for minority applicants with same creditworthiness |
| Advertising | Job ad delivery systems | STEM jobs shown disproportionately to men |
Why Explainability Matters
Fairness tells you whether a model treats groups equally. Explainability tells you why. The two are inseparable: a disparity that no one can explain cannot be defended in court, contested by a data subject, or fixed by the engineering team. Explainability is what turns a fairness number into evidence, action, and recourse.
The four jobs explainability does for the business
Validant.ai treats Explainable AI (XAI) as a peer view to Fairness, Digital Trust and SSI. Each persona that interacts with an AI decision needs the same audited result presented in a different register; XAI is the layer that makes that possible without re-running the audit.
- Defend the model to a regulator. EU AI Act Articles 13 to 14 require transparent and interpretable high-risk AI; NIST AI RMF Measure 2.10 demands that explanations be faithful to the model. A fairness disparity number without a per-feature decomposition cannot satisfy these requirements. The Lundberg fairness decomposition (CHI 2020) turns a disparity into a sum of feature contributions that the auditor can read directly; the platform asserts the 1e-6 identity before publishing, so the math is verifiable.
- Answer the data subject. GDPR Article 22 and Recital 71 give individuals the right to a meaningful explanation of an automated decision. A waterfall chart with floating-point SHAP values is not a meaningful explanation to a loan applicant; the Wachter-style counterfactual sentence ("if your reported income had risen to 46,200 the loan would have been approved") is. The Data Subject panel renders exactly that.
- Detect proxy discrimination. "Fairness through unawareness" -- removing the protected attribute from the input -- is the most common and most dangerous mistake. SHAP attribution distributions across protected groups expose features that act as proxies for the removed attribute (postal code, industry SIC code, accent profile). The proxy score quantifies the share each feature contributes to the disparity, with a default 0.15 flag threshold drawn from Lundberg's spec.
- Decide what to mitigate, where. Once the per-feature contributions are known, the intervention strategy follows. The platform's knowledge graph carries the
mitigates_viaedges -- "if SHAP shows postal_code carries 35% of the demographic-parity gap, instance reweighing on postal_code is the documented mitigation" -- with peer-reviewed citations attached to every edge. Auditors filter onevidence_class = 'theorem'to cite only mathematically backed links; engineers filter on the broader set.
Persona-tiered rendering
The same audited decision is shown four different ways depending on who is reading it. The persona is a rendering rule, not a separate report; switching persona never triggers a re-run.
| Persona | What they see | What they cannot see | Business reason |
|---|---|---|---|
| Data subject | One Wachter sentence, one counterfactual, a contest button | Numeric attributions, plots, technical detail | Numbers and plots cause over-trust in non-experts. The sentence is what the appeal-review human reads at step two. |
| Board / executive | Trust score, top three drivers, verdict (Compliant / Watchlist / Non-compliant) | Methodology, parameter controls, raw attributions | Decisions are made on a single headline metric and a 30-second drill-down. Drill-down is one click away if needed. |
| Auditor / regulator | Regulatory-article mapping, decomposition table, library versions, seed, AuditArtifact hash | Engineering-grade parameter knobs (irrelevant; would muddy the trail) | Replay capability is the single most important property of a fairness audit. Every number must trace back to a deterministic, signed artifact. |
| Engineer / data scientist | Full chart suite (waterfall, force, beeswarm, dependence, decision path), faithfulness + stability + adversarial diagnostics, parameter controls | Nothing -- the engineer is the audit's debugging surface | When a finding lands, the engineer needs to reproduce, perturb and challenge it. Density is the point. |
Honest limits
The platform documents and surfaces the limits of post-hoc explanations rather than hiding them:
- SHAP and LIME can be adversarially scaffolded. Slack et al. (AIES 2020) showed that an OOD-detection layer can hide a model's true behaviour from perturbation-based explainers. The platform ships an adversarial probe that flags suspicious explanations rather than passing them silently.
- Attribution is model-relative, not causal. SHAP tells you which feature carried the contribution under the model's logic; it does not tell you which feature caused the disparity in the real world. The Causal Modeling module addresses the causal question; XAI addresses the model-relative one.
- The GDPR right to explanation is legally contested. The Dun & Bradstreet ruling and ongoing CJEU case law have narrowed the practical scope. The platform is honest about this in the Audit panel and provides the documentation a regulator would ask for regardless.
Explainability is one of the four pillars in the validant.ai TrustPosture report (Fairness, XAI, Digital Trust, SSI). The four views share one assessment store and one synthesis layer; the regulator gets one document covering all four readings of one audited decision, not four disconnected reports.
Regulatory Landscape
The regulatory environment for AI fairness is rapidly evolving. Organizations must navigate a complex landscape of existing civil rights laws and emerging AI-specific regulations.
Current Regulatory Framework
Employment discrimination"] FCRA["Fair Credit Reporting Act
Credit decisions"] ECOA["Equal Credit Opportunity Act
Lending fairness"] FHA["Fair Housing Act
Housing discrimination"] ADA["ADA
Disability discrimination"] end subgraph EU["European Union"] GDPR["GDPR Art. 22
Automated decisions"] AIA["EU AI Act (2024)
High-risk AI systems"] EUAI["AI Liability Directive
Damage claims"] end subgraph SECTOR["Sector-Specific"] HEALTH["HIPAA / HHS
Healthcare AI"] FIN["OCC / Fed
Financial services"] INS["State laws
Insurance pricing"] end style EEOC fill:#2c5f7c,color:#fff style AIA fill:#0096a7,color:#fff
EU AI Act (2024)
The EU AI Act creates a risk-based framework for AI systems:
- High-Risk Systems: Employment, credit, education, law enforcement, immigration
- Requirements: Bias testing, human oversight, transparency, conformity assessments
- Penalties: Up to 6% of global annual turnover
US EEOC Guidelines
The Equal Employment Opportunity Commission has issued guidance on algorithmic fairness in employment:
- Disparate Impact: The "80% Rule" requires selection rates for protected groups to be at least 80% of the highest rate
- Validation Requirements: Algorithms must be job-related and consistent with business necessity
- Vendor Liability: Employers are responsible for third-party tools
This landscape is rapidly changing. NYC Local Law 144 (2023) requires bias audits for automated employment tools. Similar laws are emerging in California, Colorado, and other jurisdictions. Consult legal counsel for current requirements.
Understanding Fairness
Fairness in machine learning refers to the absence of bias or favoritism toward an individual or group based on their protected characteristics. However, defining "fairness" precisely is challenging because different fairness concepts can be mathematically incompatible.
Key Terminology
| Term | Definition | Example |
|---|---|---|
| Protected Attribute | Characteristic that defines groups for fairness analysis | Gender, race, age, disability status |
| Positive Outcome | The favorable prediction or decision | Loan approved, hired, admitted |
| Disparity | Difference in outcomes between groups | 10% approval rate gap between groups |
| Privileged Group | Group with better outcomes | Group with highest approval rate |
| Disparate Impact | When a neutral policy disproportionately affects a protected group | Using ZIP code as a proxy for race |
The Fairness Trade-off
A fundamental insight from fairness research (Kleinberg et al., 2016; Chouldechova, 2017) is that multiple fairness criteria cannot be simultaneously satisfied except in special cases. This means organizations must make principled choices about which fairness definition best aligns with their context.
Equal selection rates"] --- B["Impossibility
Theorem"] B --- C["Equal Opportunity
Equal TPR"] B --- D["Predictive Parity
Equal precision"] B --- E["Calibration
Equal probabilities"] style B fill:#ef4444,color:#fff
When these trade-offs exist, the concept of a Pareto frontier becomes essential. A Pareto frontier shows the best achievable combinations of two competing objectives — for example, model accuracy vs. fairness. Along this frontier, every improvement in one dimension requires a sacrifice in the other. Configurations that fall below the frontier are wasteful: they can be improved on both dimensions simultaneously.
For business leaders, the key takeaway is: the data science team can identify the frontier (the "art of the possible"), but choosing where on the frontier to operate is a business and ethics decision, not a technical one. See the Calibration section for a detailed visual explanation of how Pareto frontiers work in practice.
Decoding AI Fairness
Understanding the principles, trade-offs, and practical considerations of algorithmic fairness
Historical Pattern Detection
Historical patterns refer to features in your data that encode past discrimination, even if they appear neutral. vfairness includes 43 curated patterns spanning four jurisdictions, grounded in peer-reviewed research, landmark court cases, and regulatory frameworks including the EU AI Act (Regulation 2024/1689).
US / Global Patterns (12 patterns)
| Pattern | Feature Examples | Historical Context |
|---|---|---|
| Redlining | ZIP code, neighborhood, address | 1930s-1960s HOLC maps labeled minority neighborhoods as "hazardous," creating lasting wealth gaps. |
| Salary History | Previous compensation, salary requirements | Perpetuates gender and race pay gaps. Banned for hiring in many US states. |
| Credit History | Credit score, bankruptcy, collections | Reflects historical exclusion from mainstream financial services. CFPB-documented disparate impact. |
| Criminal Records | Arrest history, convictions | Reflects biased policing and sentencing. EEOC guidance restricts use in employment. |
| Healthcare Costs | Prior healthcare spending | Lower spending by minorities reflects access barriers, not health needs (Obermeyer et al., 2019). |
Also includes: Educational institution bias, legacy admissions, employment gaps, banking access, name discrimination, digital divide.
European Patterns (12 patterns)
| Pattern | Feature Examples | Context / Case |
|---|---|---|
| Migration Background | Country of origin, nationality, migration status | Dutch Toeslagenaffaire (2020) — algorithm targeted dual-nationality families for fraud. |
| Credit Scoring (SCHUFA) | Postcode score, address-based credit | SCHUFA postcode scoring ruled problematic: CJEU C-634/21 (2023), BGH ruling (2024). |
| Employment Profiling | Employability score, job-matching AI | Austrian AMS algorithm penalised women and disabled jobseekers (AlgorithmWatch, 2019). |
| Predictive Policing | Crime risk, gang association, recidivism | UK Gangs Matrix — 78% of entries were Black vs 13% of borough population (Amnesty, 2018). |
| Biometric Identification | Facial recognition, biometric data | Gender Shades study: up to 34% error rate difference by skin tone (Buolamwini & Gebru, 2018). |
Also includes: Welfare fraud scoring, exam grading, Roma/Traveller discrimination, religious identity, platform/gig scoring, social housing, language discrimination.
EU AI Act — Regulation 2024/1689 (11 patterns)
The EU AI Act is the world's first comprehensive AI regulation. vfairness maps its prohibited practices and high-risk use cases directly to data features, enabling automated compliance flagging.
These practices are banned outright in the EU. Violations carry fines up to €35 million or 7% of global annual turnover, whichever is higher.
| Pattern | AI Act Article | What It Detects |
|---|---|---|
| Social Scoring | Art. 5(1)(c) | Features aggregating social behavior into trustworthiness scores (e.g., social credit systems) |
| Emotion Recognition | Art. 5(1)(f) | Emotion or sentiment features used in workplace or education settings (e.g., engagement scoring from video) |
| Biometric Categorisation | Art. 5(1)(g) | Systems inferring race, religion, or sexual orientation from biometric data |
| Manipulative AI | Art. 5(1)(a-b) | Dark patterns, addictive design features, subliminal manipulation techniques |
These systems require risk management, data governance, human oversight, and conformity assessment. Non-compliance carries fines up to €15 million or 3% of global turnover.
| Pattern | Annex III Area | What It Detects |
|---|---|---|
| Employment & Recruitment | Area 4 | CV scoring, candidate ranking, performance monitoring, automated task allocation |
| Creditworthiness | Area 5(b) | Automated credit decisions, default prediction, lending algorithms |
| Education & Training | Area 3 | Admission scoring, automated grading, exam proctoring, student profiling |
| Essential Services | Area 5(a) | Benefit eligibility, insurance risk pricing, emergency service triage |
| Law Enforcement | Area 6 | Recidivism prediction, criminal profiling, polygraph/lie detection |
| Migration & Border | Area 7 | Asylum assessment automation, visa decisions, border risk scoring |
| Justice & Democracy | Area 8 | Judicial outcome prediction, voter targeting, election influence systems |
Swiss-Specific Patterns (8 patterns)
| Pattern | Feature Examples | Context |
|---|---|---|
| Permit System | Ausweis B/C/F/N, permit type | Permit type functions as nationality proxy. Documented by SFM/Uni Neuchâtel and EKR/CFR. |
| Betreibungsregister | Debt register entries, Betreibungsauszug | Immigrants disproportionately affected due to unfamiliarity with Swiss debt collection system (SchKG Art. 8a). |
| Housing Discrimination | Applicant name, origin in housing applications | Uni Zürich studies: 20-50% fewer callbacks for Balkan, Turkish, and African names. |
| Naturalisation Bias | Citizenship status, naturalisation outcome | BGE 129 I 217 (2003): Emmen ballot-box naturalisations ruled discriminatory by Federal Supreme Court. |
| Gemeinde-Level Data | BFS municipality code, Steuerfuss | Municipality tax multiplier and BFS classification encode significant socioeconomic differences. |
Also includes: Health insurance region bias (KVG Prämienregionen), RAV/ORP employment profiling, Sozialhilfe stigmatisation.
How Pattern Detection Works
The pattern detection engine works as a keyword-matching system backed by a curated knowledge base:
- Column scanning: Each column name in your DataFrame is checked against keyword lists for all 43 patterns
- Confidence scoring: Matches are scored based on keyword specificity and column content analysis
- Risk classification: Matched features are assigned risk levels (critical, high, medium, low) based on their pattern category
- Context & recommendations: Each finding includes historical context, affected groups, and actionable mitigation steps with regulatory references
Key References
- Rothstein, R. (2017). The Color of Law. Liveright Publishing.
- Obermeyer, Z., et al. (2019). Dissecting racial bias in healthcare algorithms. Science, 366(6464). DOI
- Buolamwini, J., & Gebru, T. (2018). Gender Shades. FAccT Conference. DOI
- EU AI Act — Regulation 2024/1689. Full text
- Barrett, L. F., et al. (2019). Emotional Expressions Reconsidered. Psychological Science in the Public Interest. DOI
- SFM/Uni Neuchâtel — Swiss Forum for Migration Studies. Website
- EKR/CFR — Swiss Federal Commission against Racism. Reports
Pattern detection works by matching column names against keyword lists (e.g., zip_code, postcode_score). It does not use semantic analysis or NLP.
geo_zone_v3 instead of zip_code), abbreviations, or non-English names may not be detected. The confidence scores are heuristic-based, not statistically calibrated.
EU AI Act pattern flags are informational screening aids — they do not constitute a conformity assessment or legal compliance certification.
Representation Bias
Representation bias occurs when the training data does not accurately reflect the population the model will serve. This can lead to models that perform poorly for underrepresented groups.
Types of Representation Bias
- Underrepresentation: A group has fewer samples than its population share
- Overrepresentation: A group has more samples than its population share
- Selection Bias: Systematic exclusion based on non-random factors
- Survivorship Bias: Only seeing outcomes for those who passed previous filters
Example Analysis
| Group | Dataset % | Population % | Ratio | Status |
|---|---|---|---|---|
| White | 75% | 60% | 1.25 | Overrepresented |
| Black | 10% | 13% | 0.77 | Underrepresented |
| Hispanic | 8% | 19% | 0.42 | Severely Underrepresented |
| Asian | 7% | 6% | 1.17 | Acceptable |
Mitigation Strategies
- Data Collection: Intentional sampling to achieve representation
- Resampling: Oversampling underrepresented groups or undersampling majority
- Weighting: Adjusting sample weights during training
- Synthetic Data: Generating additional samples for minority groups
The library does not automatically generate population benchmarks. Default benchmarks are hardcoded US Census 2020 approximations covering only race, gender (binary), and age_group.
benchmarks parameter. Source population data from:• US: Census Bureau ACS tables
• EU: Eurostat population statistics
• Switzerland: BFS/OFS demographic data (bfs.admin.ch)
• Domain-specific: Your organization's customer demographics or HR data
vfairness provides post-processing fairness interventions including:
- Threshold Optimization:
GroupThresholdOptimizer,MultiObjectiveThresholdOptimizer - Prediction Reweighting:
PredictionReweighter,RejectionOptionClassifier,CalibratedEqualizer - Calibration:
GroupCalibratorfor group-specific probability calibration
For pre-processing (resampling, reweighing training data) or in-processing (constrained optimization during training), see Training-Time Interventions or external libraries like AIF360 and Fairlearn.
Proxy Variables
Proxy variables are features that correlate with protected attributes, allowing the model to discriminate indirectly even when protected attributes are excluded.
Common Proxy Relationships
Detection Approach
vfairness uses multiple correlation measures to detect proxies:
- Cramér's V: For categorical-to-categorical relationships
- Mutual Information: Information-theoretic measure
- Pearson Correlation: For continuous variables
Proxy Risk Levels
| Correlation | Risk Level | Action |
|---|---|---|
| r < 0.3 | Low | Monitor |
| 0.3 ≤ r < 0.5 | Medium | Investigate impact |
| 0.5 ≤ r < 0.7 | High | Consider removal or mitigation |
| r ≥ 0.7 | Critical | Remove or transform feature |
Proxy detection uses statistical correlations (Pearson, Cramér's V, mutual information) — not causal analysis. Despite referencing causal fairness literature, no causal graph or do-calculus is implemented.
• DoWhy (Microsoft) for causal inference
• CausalNex for Bayesian structure learning
• Always validate flagged proxies with domain-expert review
Intersectional Analysis
Intersectionality recognizes that individuals belong to multiple demographic groups simultaneously, and discrimination may occur at the intersection of these identities even when each group appears fair in isolation.
A model may show acceptable disparities for gender (8%) and race (6%) separately, but reveal a 25% disparity for Black women when analyzed intersectionally.
Why Intersectionality Matters
Fairness Gerrymandering
Fairness gerrymandering (Kearns et al., 2018) occurs when a model satisfies fairness constraints for each protected attribute individually but violates fairness for specific subgroups. vfairness includes subgroup robustness auditing to detect this pattern.
Academic Reference
Kearns, M., Neel, S., Roth, A., & Wu, Z. S. (2018). Preventing Fairness Gerrymandering: Auditing and Learning for Subgroup Fairness. Proceedings of the 35th International Conference on Machine Learning. https://arxiv.org/abs/1711.05144
Intersectional analysis creates combined groups (e.g., race × gender × age). Groups below min_group_size (default: 30) are silently excluded from analysis.
min_group_size for exploratory analysis (with appropriate caveats about statistical reliability). Use Bayesian methods (method='bayesian') for small groups. Always check which groups were actually analysed by reviewing the results — if fewer groups appear than expected, some were dropped. Collect larger, more representative datasets where possible.
Training-Time Fairness Interventions
Training-time interventions modify the model training process itself to incorporate fairness constraints directly into the optimization objective. Unlike post-processing methods that adjust predictions after training, these approaches ensure fairness is baked into the model from the start.
Training-time interventions are most valuable when you have control over the model training process and want to achieve fairness without post-hoc adjustments. They are particularly effective when fairness constraints can be mathematically formalized.
The Accuracy-Fairness Trade-off
A fundamental reality in fair machine learning is that improving fairness often comes at some cost to accuracy. Training-time methods allow you to explore this trade-off systematically and find the best balance for your use case.
Pareto Frontier
The set of "optimal" solutions where you cannot improve fairness without sacrificing accuracy (or vice versa). Training-time methods help you find and navigate this frontier.
Lambda (λ) Parameter
Controls the fairness-accuracy trade-off. Higher λ values prioritize fairness over accuracy. The optimal λ depends on your regulatory requirements and business context.
Constraint Satisfaction
Methods can enforce hard constraints (violation must be zero) or soft constraints (minimize violation subject to accuracy). Soft constraints are more practical for most applications.
The Reductions Approach
The reductions approach (Agarwal et al., 2018) transforms fairness-constrained optimization into a sequence of weighted classification problems. This makes it compatible with any standard ML classifier.
How It Works
- Problem Formulation: Express fairness constraints as linear constraints on classifier predictions
- Iterative Reweighting: At each step, adjust sample weights to guide the classifier toward satisfying fairness constraints
- Convergence: The algorithm converges to a fair classifier that approximately minimizes error while satisfying constraints
Business Advantages
- Model Agnostic: Works with any sklearn-compatible classifier (Random Forest, Gradient Boosting, Logistic Regression, etc.)
- No Architecture Changes: Your existing model architecture remains unchanged
- Interpretable: The final model is as interpretable as your base classifier
- Guaranteed Constraints: Can achieve exact constraint satisfaction with sufficient iterations
When to Use Reductions
| Scenario | Fit | Rationale |
|---|---|---|
| Traditional ML models (tree-based, linear) | Excellent | Direct sklearn integration, no code changes needed |
| Explainability requirements | Excellent | Base model interpretability is preserved |
| Multiple fairness constraints | Excellent | Handles multiple constraints naturally |
| Deep learning models | Poor | Not designed for differentiable end-to-end training |
Academic Reference
Agarwal, A., Beygelzimer, A., Dudík, M., Langford, J., & Wallach, H. (2018). A Reductions Approach to Fair Classification. Proceedings of ICML 2018. arXiv:1803.02453
Lagrangian Methods (Deep Learning)
Lagrangian methods add fairness penalties directly to the loss function during neural network training. This approach is well-suited for deep learning where you have access to the training loop and can compute gradients through fairness metrics.
How It Works
The optimization objective becomes:
Where λ controls the trade-off between task performance and fairness constraint satisfaction.
Business Advantages
- End-to-End Training: Fairness is learned jointly with the task objective
- Gradient-Based Optimization: Leverages efficient deep learning optimizers
- Flexible Constraints: Can incorporate differentiable approximations of various fairness metrics
- Scalability: Handles large datasets and complex models efficiently
When to Use Lagrangian Methods
| Scenario | Fit | Rationale |
|---|---|---|
| Deep learning / neural networks | Excellent | Native integration with PyTorch/TensorFlow training loops |
| Large-scale data | Excellent | Mini-batch training maintains efficiency |
| Custom fairness metrics | Excellent | Any differentiable metric can be added to loss |
| Tree-based models | Poor | Non-differentiable; use reductions instead |
Choosing the Right Approach
The choice between reductions and Lagrangian methods depends primarily on your model architecture and operational requirements.
Neural Network?"} DL -->|Yes| LAG["Lagrangian Methods"] DL -->|No| SKLEARN{"sklearn-compatible
classifier?"} SKLEARN -->|Yes| RED["Reductions Approach"] SKLEARN -->|No| CUSTOM["Custom Implementation"] LAG --> LAG_USE["Use fairness loss functions
in training loop"] RED --> RED_USE["Use ExponentiatedGradient
or GridSearch wrapper"] style LAG fill:#6366f1,color:#fff style RED fill:#10b981,color:#fff style LAG_USE fill:#e0e7ff,color:#1e1b4b style RED_USE fill:#d1fae5,color:#064e3b
Decision Factors
| Factor | Reductions | Lagrangian |
|---|---|---|
| Model Type | Any sklearn classifier | Neural networks |
| Training Loop Access | Not required (wrapper) | Required (modify loss) |
| Constraint Satisfaction | Guaranteed (with iterations) | Approximate (soft penalty) |
| Implementation Effort | Low (use FairClassifier) | Medium (add loss terms) |
| Interpretability | Preserved from base model | Typical NN interpretability |
Start with reductions if you're using traditional ML models — it's simpler to implement and provides strong theoretical guarantees. Use Lagrangian methods for deep learning where you need end-to-end differentiable training.
Key References
- Agarwal, A., et al. (2018). A Reductions Approach to Fair Classification. ICML 2018.
- Cotter, A., et al. (2019). Optimization with Non-Differentiable Constraints. JMLR 20(172).
- Zafar, M. B., et al. (2017). Fairness Constraints: Mechanisms for Fair Classification. AISTATS 2017.
Calibration
Calibration for Fairness
Understanding probability calibration across demographic groups and its impact on fair decision-making
Definition: When a model outputs a probability (e.g., "70% chance of loan default"), that probability should reflect reality equally for all groups. Calibration fairness ensures that a 70% prediction means a 70% actual rate — whether the applicant is male or female, young or old.
"If our credit model says an applicant has a 30% chance of defaulting, then among all applicants given that score — regardless of their race, gender, or age — approximately 30% should actually default. If that rate is 30% for one group but 45% for another, the model is miscalibrated."
Why Calibration Matters
Many AI fairness discussions focus on selection rates or error rates. But in domains where decisions depend on predicted probabilities — not just binary yes/no decisions — calibration is the critical fairness dimension:
- Credit scoring — interest rates and credit limits are set based on risk probabilities
- Insurance — premiums are directly derived from predicted claim probabilities
- Criminal justice — bail and parole decisions use recidivism risk scores
- Healthcare — treatment urgency depends on predicted illness probability
- Marketing — customer lifetime value predictions drive resource allocation
A model can have perfect Demographic Parity (equal approval rates) while being badly miscalibrated: it might over-predict risk for one group and under-predict it for another, leading to unfair pricing, wrong treatment prioritisation, or discriminatory interest rates.
Mathematical Definition
For each group, the Expected Calibration Error (ECE) measures the gap between predicted probabilities and actual outcome rates:
ECE(group) = Σ (bin_weight × |mean_predicted_prob − actual_positive_rate|)
Calibration Difference is the maximum ECE gap between any two groups:
Calibration Difference = max(ECE(A), ECE(B), ...) − min(ECE(A), ECE(B), ...)
Key Metric
| Metric | What It Measures | Ideal Value | Threshold |
|---|---|---|---|
| Calibration Difference | Max difference in Expected Calibration Error between groups | 0 | < 0.05 |
Interpretation Thresholds
| Range | Assessment | Action |
|---|---|---|
| < 0.03 | Excellent | No action needed — model is well-calibrated for all groups |
| 0.03 – 0.05 | Acceptable | Monitor over time; document in fairness report |
| 0.05 – 0.08 | Concerning | Investigate root cause; consider group-specific calibration |
| ≥ 0.10 | Critical | Mandatory remediation before deployment |
Decision Framework
output probabilities?"] --> Q1{"Are decisions based on
the probability value
(not just yes/no)?"} Q1 -->|"No — only binary
decisions"| SKIP["Focus on classification
fairness metrics instead"] Q1 -->|"Yes — rates, prices,
risk scores"| Q2{"Compute Calibration
Difference across groups"} Q2 --> CHECK{"Calibration
Difference < 0.05?"} CHECK -->|"Yes"| OK["✅ Well-calibrated
Document & monitor"] CHECK -->|"No"| FIX{"Choose remediation
strategy"} FIX -->|"Small dataset
or simple model"| PLATT["Platt Scaling
(per group)"] FIX -->|"Large dataset
complex model"| ISO["Isotonic Regression
(per group)"] FIX -->|"Neural network"| TEMP["Temperature Scaling"] style START fill:#2c5f7c,color:#fff style SKIP fill:#94a3b8,color:#fff style OK fill:#10b981,color:#fff style FIX fill:#f59e0b,color:#fff style PLATT fill:#6366f1,color:#fff style ISO fill:#6366f1,color:#fff style TEMP fill:#6366f1,color:#fff
When to Use
- Your model outputs probabilities or risk scores, not just binary decisions
- Downstream decisions (pricing, prioritisation, resource allocation) use the probability value itself
- Regulatory context requires consistent meaning of predictions across groups (e.g., EU AI Act Article 10)
- You are building risk assessment tools in finance, healthcare, or criminal justice
The Impossibility Theorem
Kleinberg et al. (2016) and Chouldechova (2017) proved that when base rates (the true positive rate in the population) differ between groups, calibration, equal false positive rates, and equal false negative rates cannot all be satisfied simultaneously.
This means organizations must make a principled choice: you can have a well-calibrated model or equalized error rates, but not both — unless the underlying base rates happen to be identical across groups.
The Pareto Frontier: Navigating Trade-offs
Given the impossibility theorem, organizations face a practical question: if we can't have everything, what is the best we can achieve? This is where the Pareto frontier comes in.
Imagine plotting every possible configuration of your model on a chart, with calibration quality on one axis and fairness on the other. Some configurations are strictly better than others on both dimensions — those worse ones are called dominated and should always be discarded.
The remaining configurations form a curve — the Pareto frontier. Every point on this curve represents a configuration where you cannot improve calibration without sacrificing some fairness, or vice versa. There is no free lunch beyond this line.
What a Pareto Frontier Looks Like
The chart below is a typical Pareto frontier. The blue curve shows the best achievable combinations. The red dots inside the shaded area are configurations that can be improved on both dimensions — no reason to stay there.
Think of it like a company's annual budget. You want to invest in both marketing and R&D, but your total budget is fixed. You can spend more on marketing — but only by taking money from R&D, and vice versa. There are many wasteful allocations where money sits idle (dominated points) — those should be eliminated immediately. Once you've eliminated waste, you're left with a set of efficient allocations (the frontier), and the final split is a strategic decision based on your business goals, not a technical calculation.
The Pareto frontier in AI fairness works the same way: the "budget" is spread between calibration quality and fairness, and leadership must decide the right balance.
Accurate probabilities,
but groups treated differently"] B["⚖️ Balanced
Moderate calibration +
moderate fairness"] C["Prioritise Fairness ➡
Groups treated equally,
but probabilities less reliable"] end A --- B --- C D["❌ Dominated Position
Worse on BOTH axes —
always move to the frontier"] -.->|"Improve
for free"| B style A fill:#3b82f6,color:#fff style B fill:#10b981,color:#fff style C fill:#8b5cf6,color:#fff style D fill:#ef4444,color:#fff
How to Use the Pareto Frontier in Practice
| Step | Action | Who Decides |
|---|---|---|
| 1. Map | Use the library to test different thresholds and calibration methods, plotting calibration error vs. fairness violation | Data Science / ML team |
| 2. Eliminate | Discard any dominated configurations — these are strictly worse than alternatives on the frontier | Data Science / ML team |
| 3. Choose | Select where on the frontier to operate, based on regulatory requirements, risk appetite, and organizational values | Business leadership + Legal + Ethics board |
| 4. Document | Record the chosen operating point and rationale — essential for audit trails and regulatory compliance | Governance / Compliance |
The Pareto frontier separates technical decisions ("move to the frontier") from values decisions ("choose where on the frontier to operate"). The first is objective — dominated configurations should always be eliminated. The second requires human judgement about how to balance competing priorities, and this decision should involve business, legal, and ethics stakeholders — not just the ML team.
Example Interpretation
Result: Calibration Difference = 0.09
Interpretation: The model's ECE is 0.12 for Group A but 0.03 for Group B. When the model predicts "60% default risk" for Group A, the actual default rate is roughly 48–72% — a wide band. For Group B, the same prediction aligns tightly with reality (57–63%).
Impact: Group A borrowers receive interest rates based on unreliable risk estimates. Some creditworthy individuals pay too much; some risky individuals pay too little.
Action: Apply group-specific isotonic calibration. Retrain with balanced calibration data. Report the ECE gap in the fairness assessment under the EU AI Act.
Limitations
- Requires the model to output actual probabilities — not just class labels
- ECE depends on binning; with small groups or extreme probabilities, estimates become noisy
- Improving calibration for one group may worsen it for another if base rates differ significantly
- Does not measure discrimination in who receives positive outcomes — only whether probability estimates are trustworthy
Relationship to Other Metrics
| Metric | What It Ensures | Compatible with Calibration? |
|---|---|---|
| Demographic Parity | Equal selection rates | Only if base rates are equal |
| Equal Opportunity | Equal TPR | Trade-off exists with unequal base rates |
| Equalized Odds | Equal TPR + FPR | Provably incompatible (Kleinberg et al.) |
| Predictive Parity | Equal precision | Closely related; both concern prediction reliability |
Using CalibrationAnalyzer in vfairness
The CalibrationAnalyzer class provides a unified interface for all calibration analysis. It automates the workflow of evaluating calibration, detecting disparities, and recommending remediation strategies.
- Evaluate: Computes ECE, MCE, and Brier scores for overall data and per demographic group
- Detect: Identifies calibration disparities and flags critical issues
- Diagnose: Checks if the impossibility theorem applies to your data
- Recommend: Provides context-aware recommendations (lending, healthcare, hiring, etc.)
- Remediate: Applies group-specific calibration using Platt, Isotonic, Beta, or Temperature scaling
- Report: Generates comprehensive reports for documentation and compliance
+ protected attribute"] --> CA["CalibrationAnalyzer"] CA --> EVAL["Evaluate
ECE, MCE, Brier"] CA --> DISP["Detect
Disparities"] CA --> TRADE["Analyze
Trade-offs"] EVAL --> REPORT["CalibrationReport"] DISP --> REPORT TRADE --> REPORT REPORT --> DECIDE{"Well
calibrated?"} DECIDE -->|"Yes"| DOC["Document &
monitor"] DECIDE -->|"No"| FIX["Apply group-specific
calibration"] FIX --> IMPROVED["Calibrated
probabilities"] style CA fill:#6366f1,color:#fff style REPORT fill:#10b981,color:#fff style IMPROVED fill:#10b981,color:#fff
Key Outputs for Business Users
| Output | What It Tells You | Business Action |
|---|---|---|
is_well_calibrated |
True if overall ECE < 0.05 | Green light for deployment (with monitoring) |
has_significant_disparity |
True if ECE disparity > 0.05 | Requires investigation before deployment |
critical_issues |
List of severe problems found | Prioritise these for remediation |
recommendations |
Prioritised action items | Technical guidance for the ML team |
report.summary() |
Human-readable report text | Include in fairness documentation |
See the CalibrationAnalyzer API Reference for code examples and detailed parameter documentation.
Fairness Metrics Across Model Types
How fairness measurement adapts to classification, regression, and ranking systems
Group-Specific Threshold Optimization
Definition: Rather than using a single decision threshold (like 0.5) for all groups, threshold optimization finds the optimal per-group thresholds that satisfy fairness constraints while minimizing accuracy loss.
Threshold optimization is mathematically proven to be the optimal post-processing solution for achieving fairness constraints (Hardt et al., 2016). It works on any model that outputs probabilities, requires no retraining, and preserves the model's relative ordering of predictions.
How It Works
Consider a loan approval model that outputs probability scores. Currently, everyone with a score ≥ 0.5 gets approved. But if Group A historically has systematically higher scores due to data biases, they get approved more often. Threshold optimization might find:
- Group A threshold: 0.52 (slightly stricter)
- Group B threshold: 0.47 (slightly more lenient)
This equalizes approval rates while minimizing the total number of decisions that change.
Business Scenarios
| Scenario | When to Use Threshold Optimization |
|---|---|
| Vendor-provided model | You can't retrain the model but need to meet fairness requirements |
| Regulatory compliance deadline | Need a quick fairness fix while working on a longer-term solution |
| Frozen pipeline | Model is embedded in production systems that can't be easily modified |
| A/B testing fairness | Compare fair vs unfair model without retraining |
Reference
Hardt, M., Price, E., & Srebro, N. (2016). Equality of Opportunity in Supervised Learning. NeurIPS 2016.
Threshold Trade-off Analysis
Different threshold configurations create different trade-offs between fairness constraints and accuracy. The ThresholdAnalyzer helps you understand these trade-offs and make informed decisions.
The impossibility theorems (Chouldechova 2017, Kleinberg et al. 2016) apply to threshold optimization too: you often cannot satisfy multiple fairness constraints simultaneously. The analyzer helps you understand which trade-offs are possible.
Key Analysis Capabilities
- Pareto Frontier: Visualize the optimal trade-off curve between fairness and accuracy
- Sensitivity Analysis: Understand how small threshold changes affect outcomes
- Constraint Comparison: Compare solutions for different fairness constraints
- Impact Assessment: See exactly which predictions change under each configuration
Prediction Reweighting
Definition: Unlike threshold optimization which only changes the decision boundary, prediction reweighting modifies the predicted probabilities themselves to achieve fairness.
Use reweighting when the probability estimates themselves need to be fair — not just the binary decisions. This matters for:
- Risk scoring: Insurance premiums, credit limits, bail amounts based on probability
- Ranking: Job candidate ranking, loan prioritization
- Downstream decisions: When probabilities feed into other systems
Available Methods
| Method | Approach | Impact on Calibration | Best For |
|---|---|---|---|
| Multiplicative | Scale probabilities by group-specific factors | Preserves relative ordering within groups | Simple, interpretable adjustments |
| Additive | Add/subtract constant offset per group | Shifts distributions uniformly | When multiplicative creates extreme values |
| Distribution Matching | Transform distributions to match across groups | Strongest guarantee but may distort calibration | Maximum fairness requirement |
| Calibrated Equalizer | Combine calibration with fairness | Maintains calibration while improving fairness | When both calibration and fairness matter |
Rejection Option Classification
Definition: Only modify predictions that fall within an "uncertainty region" near the decision boundary. High-confidence predictions are left unchanged.
ROC embodies the principle that the model is likely reliable when it's confident. A prediction of 0.95 or 0.05 probably reflects real signal. But a prediction of 0.51 vs 0.49? That's where the model is uncertain, and where fairness-based adjustments are least likely to override genuine predictive information.
How It Works
Define a critical region around the threshold (e.g., [0.4, 0.6] for threshold 0.5):
- Outside critical region: Predictions unchanged (high confidence)
- Inside critical region: Predictions may be flipped to improve group fairness
The width of the critical region (θ parameter) controls the trade-off: larger θ = more fairness improvement but more changed predictions.
Business Advantages
- Preserves accuracy: High-confidence predictions (the majority) are unchanged
- Defensible: Only changes uncertain cases where human decision-makers would also be uncertain
- Tunable: Adjust θ to find acceptable fairness-accuracy balance
Reference
Kamiran, F., Karim, A., & Zhang, X. (2012). Decision Theory for Discrimination-Aware Classification. ICDM 2012.
Demographic Parity
Definition: All groups receive positive outcomes at the same rate, regardless of their qualifications.
"If we approve 40% of applicants overall, we should approve approximately 40% of men and 40% of women."
Mathematical Definition
For groups A and B:
P(Approved | Group A) = P(Approved | Group B)
Key Metrics
| Metric | Formula | Ideal Value | Threshold |
|---|---|---|---|
| Demographic Parity Difference | |Rate(A) - Rate(B)| | 0 | < 0.10 |
| Demographic Parity Ratio (80% Rule) | min(Rate) / max(Rate) | 1.0 | ≥ 0.80 |
When to Use
- Outcomes should be equally distributed (e.g., exposure to opportunities)
- Historical data may be contaminated by past discrimination
- Legal requirements mandate equal selection rates
- No reliable "ground truth" for who deserves positive outcomes
Limitations
- May require different thresholds for different groups
- Doesn't account for differences in qualifications
- Can conflict with predictive accuracy
Example Interpretation
Result: Demographic Parity Ratio = 0.75
Interpretation: The disadvantaged group receives positive outcomes at 75% the rate of the advantaged group. This falls below the 80% threshold and may indicate disparate impact.
Action: Investigate root causes. Consider adjusting model thresholds or examining training data for historical bias.
Equal Opportunity
Definition: Among people who truly deserve a positive outcome, all groups have an equal chance of receiving it.
"Among qualified applicants who would actually repay a loan, men and women should have equal approval rates."
Mathematical Definition
Equal True Positive Rates (TPR):
P(Approved | Actually Qualified, Group A) = P(Approved | Actually Qualified, Group B)
Key Metric
| Metric | Formula | Ideal Value | Threshold |
|---|---|---|---|
| Equal Opportunity Difference | |TPR(A) - TPR(B)| | 0 | < 0.10 |
When to Use
- You have reliable ground truth labels
- Focus is on not missing qualified individuals
- Accepting some unqualified individuals is less harmful than rejecting qualified ones
- Examples: College admissions, loan approvals for creditworthy applicants
Limitations
- Requires accurate ground truth (often unavailable or biased)
- Ignores false positive rates
- May allow disparate false positive rates across groups
Equalized Odds
Definition: Error rates (both false positives and false negatives) are equal across groups.
"The model should make the same types of mistakes at the same rates for all groups. If we wrongly approve 5% of unqualified men, we should wrongly approve 5% of unqualified women."
Mathematical Definition
Equal TPR AND equal FPR:
TPR(A) = TPR(B) AND FPR(A) = FPR(B)
Key Metric
| Metric | Formula | Ideal Value | Threshold |
|---|---|---|---|
| Equalized Odds Difference | max(|TPR diff|, |FPR diff|) | 0 | < 0.10 |
When to Use
- Both types of errors matter equally
- High-stakes decisions where fairness of errors is paramount
- Criminal justice, medical diagnosis, credit decisions
Limitations
- Stricter than equal opportunity (harder to satisfy)
- Requires accurate ground truth labels
- Mathematically incompatible with calibration when base rates differ
Predictive Parity
Definition: When the model predicts a positive outcome, it should be equally accurate for all groups.
"If we approve an applicant, they should have the same probability of actually being creditworthy, regardless of their demographic group."
Mathematical Definition
Equal Positive Predictive Value (Precision):
P(Actually Qualified | Approved, Group A) = P(Actually Qualified | Approved, Group B)
Key Metric
| Metric | Formula | Ideal Value | Threshold |
|---|---|---|---|
| Predictive Parity Difference | |Precision(A) - Precision(B)| | 0 | < 0.10 |
When to Use
- The meaning of a positive prediction should be consistent
- Resource allocation based on predictions
- When downstream actors rely on prediction accuracy
Regression Fairness
Definition: When a model predicts continuous values (prices, salaries, risk scores, wait times), fairness means the model's errors should be equally distributed across groups — no group should systematically receive less accurate predictions.
"If our model estimates home values, its mistakes should not be consistently larger — or consistently biased in one direction — for minority neighborhoods compared to others."
Why It Matters
Classification fairness metrics (Demographic Parity, Equal Opportunity, etc.) assume a binary approve/reject decision. But many high-impact AI systems produce continuous outputs:
- Insurance pricing — premium amounts per policyholder
- Real-estate valuation — automated property appraisals
- Salary prediction — compensation benchmarking tools
- Healthcare — predicted cost of care, readmission risk scores
- Credit — interest rate or credit limit assignment
For these systems, asking "is the approval rate equal?" is the wrong question. The right question is: "are the errors equally distributed?"
Key Metrics
| Metric | What It Measures | Ideal Value | Business Interpretation |
|---|---|---|---|
| MAE Parity Difference | Gap in Mean Absolute Error between the best- and worst-served groups | 0 | A gap of $5,000 means one group's predictions are, on average, $5K less accurate |
| RMSE Parity Difference | Gap in Root Mean Square Error — penalises large outlier errors more than MAE | 0 | Surfaces cases where one group has rarer but very large prediction errors |
| Mean Prediction Difference | Gap in average predictions between groups (directional bias) | 0 | Shows if the model systematically over- or under-predicts for a group |
When to Use
- Your model outputs a continuous number rather than a binary decision
- You want to ensure prediction accuracy is equitable, not just outcomes
- Regulatory requirements address prediction quality per group (e.g., EU AI Act high-risk systems)
- Downstream decisions (loan amount, premium, salary offer) depend on the magnitude of the prediction
Example Interpretation
Result: MAE Parity Difference = $12,400 | Mean Prediction Difference = −$8,200
Interpretation: The model's appraisals are $12.4K less accurate for one group on average. The negative mean prediction difference reveals a systematic undervaluation of properties in that group — echoing well-documented appraisal discrimination (Brookings, 2018).
Action: Audit training data for historically biased appraisals. Consider group-specific calibration or removing proxy features (e.g., neighborhood-level features correlated with race).
Limitations
- Requires sufficient samples per group (vfairness defaults to min 30 per group)
- Does not capture tail fairness — extreme outlier errors that affect a few individuals badly
- Equalising error across groups may conflict with overall model accuracy
Ranking Fairness
Definition: In systems that produce ranked lists — search results, recommendation feeds, candidate shortlists — fairness means that no group is systematically pushed to lower, less visible positions.
"In a job-candidate ranking, qualified candidates from all demographic groups should appear in top positions proportionally — not be consistently buried at the bottom where recruiters never look."
Why It Matters
Rankings are attention-scarce: users overwhelmingly interact with the top few results. A system that is perfectly "fair" in who it includes but consistently ranks one group lower is unfair in practice.
- Hiring / recruitment — candidate ranking in ATS platforms
- E-commerce — product or seller visibility in search results
- Content platforms — news article or creator exposure in feeds
- Advertising — ad placement determining who sees job and housing opportunities
- Education — course or scholarship recommendation ordering
Key Metrics
| Metric | What It Measures | Ideal Value | Business Interpretation |
|---|---|---|---|
| Exposure Parity Difference | Gap in visibility (exposure) between the most- and least-exposed groups | 0 | Measures whether all groups receive comparable "screen time" in the ranking |
| Attention-Weighted Rank Fairness | Accounts for realistic user attention patterns — users look at top results more | Fair | A richer metric that models how quickly user attention drops off down the list |
Exposure Decay Models
Not every position in a ranking receives equal attention. vfairness supports three models of how attention decays with position:
| Model | Formula | Best For |
|---|---|---|
| Logarithmic (default) | 1 / log₂(rank + 1) | Web search — mirrors real click-through-rate curves (Joachims et al., 2017) |
| Linear | 1 / rank | Simple position-based analysis; easy to interpret |
| Geometric | 0.9rank | Feed-style interfaces where attention drops off exponentially (social media, news feeds) |
When to Use
- Your system produces an ordered list rather than a single decision
- Position in the list affects real-world outcomes (clicks, interviews, visibility)
- You need to comply with platform fairness requirements (e.g., EU Digital Services Act)
- Stakeholders want to verify that no group is systematically "buried" in results
Example Interpretation
Result: Exposure Parity Difference = 0.23 | Attention-Weighted Fairness: Unfair
Interpretation: One demographic group receives 23% less exposure in top positions. Recruiters reviewing the top 10 candidates disproportionately see candidates from the advantaged group.
Action: Review ranking algorithm for proxy features. Consider re-ranking strategies that interleave qualified candidates from under-exposed groups. Validate with the cascade attention model for more realistic assessment.
Limitations
The current ranking metrics measure group-level visibility without accounting for item relevance or quality. A ranking that gives perfect exposure parity but ignores relevance is not useful.
Mitigation: Combine vfairness ranking metrics with standard information-retrieval quality metrics (NDCG, MAP). For relevance-aware fair ranking, consider the FA*IR algorithm (Zehlike et al., 2017) or LinkedIn's equity-of-attention framework.
Choosing the Right Metric
Selecting appropriate fairness metrics requires understanding your context, stakeholders, and values. The first question is: what type of output does your model produce?
Decision Framework
model output?"} MTYPE -->|"Binary decision
(approve / reject)"| Q1{"Do you have
reliable ground truth?"} MTYPE -->|"Continuous value
(price, score, amount)"| REG["Use Regression
Fairness Metrics"] MTYPE -->|"Ranked list
(search, recommendations)"| RANK["Use Ranking
Fairness Metrics"] Q1 -->|No| DP["Use Demographic Parity"] Q1 -->|Yes| Q2{"What matters more?"} Q2 -->|"Missing qualified
individuals"| EO["Use Equal Opportunity"] Q2 -->|"Both types of
errors equally"| EOD["Use Equalized Odds"] Q2 -->|"Prediction meaning
consistency"| PP["Use Predictive Parity"] REG --> REG_Q{"Concerned about
direction of errors?"} REG_Q -->|"Yes — systematic
over/under-prediction"| MPD["Mean Prediction
Difference"] REG_Q -->|"No — just overall
accuracy gap"| MAE_RMSE["MAE + RMSE
Parity Difference"] RANK --> RANK_Q{"What interface
type?"} RANK_Q -->|"Search results"| EXP["Exposure Parity
(log decay)"] RANK_Q -->|"Feeds / scrollable"| AWRF["Attention-Weighted
Rank Fairness"] DP --> COMBINE EO --> COMBINE EOD --> COMBINE PP --> COMBINE MPD --> COMBINE MAE_RMSE --> COMBINE EXP --> COMBINE AWRF --> COMBINE COMBINE["Consider using multiple
metrics as a suite"] style START fill:#2c5f7c,color:#fff style MTYPE fill:#2c5f7c,color:#fff style DP fill:#10b981,color:#fff style EO fill:#10b981,color:#fff style EOD fill:#10b981,color:#fff style PP fill:#10b981,color:#fff style REG fill:#6366f1,color:#fff style RANK fill:#f59e0b,color:#fff style MPD fill:#6366f1,color:#fff style MAE_RMSE fill:#6366f1,color:#fff style EXP fill:#f59e0b,color:#fff style AWRF fill:#f59e0b,color:#fff
Metric Selection by Domain
| Domain | Model Type | Primary Metric | Rationale |
|---|---|---|---|
| Employment Screening | Classification | Demographic Parity Ratio (80% Rule) | EEOC legal requirement |
| Credit Decisions | Classification | Equal Opportunity + Predictive Parity | Don't miss creditworthy borrowers; consistent risk assessment |
| Medical Diagnosis | Classification | Equalized Odds | Both false positives and negatives cause harm |
| Advertising | Classification | Demographic Parity | Equal exposure to opportunities |
| Criminal Justice | Classification | Equalized Odds + Calibration | High stakes; need error parity and accurate risk levels |
| Insurance Pricing | Regression | MAE Parity + Mean Prediction Diff. | Premiums must be accurate and unbiased across groups |
| Property Valuation | Regression | MAE Parity + RMSE Parity | Appraisal accuracy must not vary by neighbourhood demographics |
| Salary Prediction | Regression | Mean Prediction Difference | Detect systematic under-/over-estimation for any group |
| Candidate Ranking (ATS) | Ranking | Attention-Weighted Rank Fairness | Recruiter attention is top-heavy; must ensure visibility for all groups |
| Search / Recommendations | Ranking | Exposure Parity (log decay) | Equal "screen time" across demographic groups |
| News / Content Feeds | Ranking | Exposure Parity (geometric decay) | Feed scroll-off rates follow exponential attention patterns |
We recommend using multiple metrics rather than a single metric. vfairness generates comprehensive reports with all applicable metrics so you can assess fairness from multiple perspectives. Note the color coding in the decision tree: ■ classification, ■ regression, ■ ranking.
Audit Workflow
A comprehensive fairness audit should follow a structured process. vfairness supports each stage with appropriate tools.
Historical patterns · Representation bias
Proxy variables · Label quality"] B["2 · Model Audit
Fairness metrics · Intersectional analysis
Group comparisons · Severity assessment"] C["3 · Statistical Validation
Confidence intervals · Significance tests
Effect sizes · Multiple-testing correction"] D["4 · Documentation
Fairness reports · Methodology
Remediation rationale · Audit trail"] E["5 · Continuous Monitoring
CI/CD gates · Automated alerts
Periodic re-audit · Trend analysis"] A ==> B ==> C ==> D ==> E E -.->|"Re-audit cycle"| A style A fill:#fef3c7,stroke:#d97706,stroke-width:2px,color:#92400e style B fill:#dbeafe,stroke:#2c5f7c,stroke-width:2px,color:#1e3a5f style C fill:#e0e7ff,stroke:#6366f1,stroke-width:2px,color:#312e81 style D fill:#fce7f3,stroke:#db2777,stroke-width:2px,color:#831843 style E fill:#d1fae5,stroke:#059669,stroke-width:2px,color:#064e3b
Stage 1: Data Audit
Before examining model outputs, audit the training data for potential bias sources:
- Identify historical discrimination patterns
- Check group representation against benchmarks
- Detect proxy variables correlated with protected attributes
- Assess label quality and potential label bias
Stage 2: Model Audit
Evaluate model predictions across protected groups:
- Compute multiple fairness metrics
- Perform intersectional analysis
- Identify privileged and disadvantaged groups
- Assess severity of disparities
Stage 3: Statistical Validation
Validate findings with rigorous statistical methods:
- Compute confidence intervals (bootstrap or Bayesian)
- Conduct permutation tests for significance
- Calculate effect sizes for practical significance
- Apply multiple testing corrections
Stage 4: Documentation
Document findings for stakeholders and regulators:
- Generate comprehensive fairness reports
- Include methodology and limitations
- Document remediation decisions and rationale
- Maintain audit trail for compliance
Stage 5: Continuous Monitoring
Fairness must be monitored over time as data distributions shift:
- Integrate fairness checks into CI/CD pipeline
- Set up automated alerts for threshold violations
- Re-audit periodically and after model updates
- Track metrics over time for trend analysis
Interpreting Results
vfairness provides rich output including metrics, confidence intervals, effect sizes, and explanations. Understanding how to interpret these results is crucial for informed decision-making.
Severity Levels
vfairness categorizes findings into severity levels:
| Severity | Metric Range | Interpretation | Action |
|---|---|---|---|
| Info | < 5% | Excellent fairness, within best practices | Continue monitoring |
| Low | 5-10% | Acceptable, minor disparity | Monitor trends |
| Medium | 10-15% | Concerning, investigate further | Root cause analysis |
| High | 15-20% | Significant disparity | Remediation required |
| Critical | > 20% | Severe, likely compliance violation | Immediate action |
Effect Size Interpretation
Effect sizes measure practical significance beyond statistical significance:
| Cohen's d | Interpretation | Practical Meaning |
|---|---|---|
| < 0.2 | Negligible | Difference unlikely to matter in practice |
| 0.2 - 0.5 | Small | Visible to careful observers |
| 0.5 - 0.8 | Medium | Noticeable in daily experience |
| 0.8 - 1.2 | Large | Obvious, substantial impact |
| > 1.2 | Very Large | Dramatic, unmistakable difference |
Confidence Intervals
Always report confidence intervals rather than point estimates alone:
- If CI excludes threshold: Confident conclusion about pass/fail
- If CI spans threshold: Uncertainty; need more data or investigation
- Wide CI: High uncertainty, often due to small sample size
Thresholds & Standards
Choosing appropriate thresholds requires balancing legal requirements, industry standards, organizational values, and statistical considerations.
Common Standards
| Standard | Threshold | Source | Notes |
|---|---|---|---|
| 80% Rule (4/5ths Rule) | Selection ratio ≥ 0.80 | EEOC Guidelines | Legal safe harbor for employment |
| 10% Difference | |difference| < 0.10 | Academic convention | Widely used in ML fairness research |
| Statistical Significance | p < 0.05 | Statistical convention | Evidence against null hypothesis |
| Practical Significance | Cohen's d > 0.2 | Cohen (1988) | Minimum for practical relevance |
Use both statistical and practical significance. A disparity can be statistically significant but negligible in practice (large sample), or practically significant but not statistically significant (small sample).
Remediation Strategies
When fairness issues are identified, several remediation approaches are available:
Data & Preprocessing (Data-Level)
- Resampling: Balance representation across groups
- Reweighting: Adjust sample weights to reduce bias
- Feature Selection: Remove or transform problematic features
- Label Correction: Address label bias in training data
Training-Time Interventions (Model-Level)
- Fairness Constraints: Add fairness terms to optimization objective
- Adversarial Debiasing: Train to reduce protected attribute predictability
- Fair Representations: Learn embeddings that are fair by construction
Prediction-Time Interventions (Decision-Level)
- Threshold Adjustment: Different thresholds for different groups
- Calibration: Adjust predictions to achieve fairness
- Reject Option: Human review for uncertain predictions
Some remediation strategies (e.g., different thresholds) may themselves raise legal concerns depending on jurisdiction. Consult legal counsel before implementation.
For the full collection of academic references, DOIs, and links, see the Academic References page.
Production Monitoring
A fairness audit at launch is a snapshot, not a guarantee. Without continuous monitoring, fairness degrades silently in production — often discovered only through customer complaints or regulatory inquiries.
Why Monitoring Cannot Be an Afterthought
Production AI systems are dynamic. They interact with an ever-changing world: user behavior shifts, upstream data pipelines evolve, and feedback loops between predictions and future training data can amplify even small residual biases into significant discriminatory harms. The scientific consensus (Barocas et al., 2023; Garg et al., 2024) is clear: one-time pre-deployment fairness assessments provide a false sense of security.
The business cost of reactive discovery is high. A financial institution that detects a loan-approval disparity through a regulatory audit faces fines, mandatory remediation programs, and reputational damage. The same institution, with proactive monitoring in place, catches the same drift within days and retrains before any customer is materially harmed — and before the regulator ever sees it.
What vfairness Now Provides
The monitoring module in Part 5 — Operations & Monitoring delivers three integrated capabilities that move organizations from reactive crisis management to proactive fairness assurance:
| Capability | Components | Business Function |
|---|---|---|
| Real-Time Metric Tracking | FairnessMonitor, TemporalFairnessAnalyzer |
Continuously computes disparate impact, demographic parity, and equalized odds over sliding windows. Surfaces emerging bias within the same batch cycle — not the next audit quarter. |
| Drift Detection | FairnessDriftDetector, Distribution Shift Score |
Distinguishes statistically meaningful fairness degradation from normal operational noise. Detects both sudden shocks (a pipeline change) and slow-moving trends (a seasonal feedback loop) using wavelet decomposition and sequential probability ratio tests. |
| Intelligent Alerting | AdaptiveThresholdManager, FairnessAlertPrioritizer |
Routes only the alerts that matter. Self-adjusting thresholds learn from operator feedback to reduce alert fatigue. A multi-factor priority score — weighting regulatory risk, population impact, and drift velocity — routes critical issues to an on-call engineer and low-priority issues to a backlog ticket. |
Business Scenarios and Expected Outcomes
Financial Services — Loan Origination
A credit model that passes a pre-launch fairness audit may still exhibit equalized-odds drift for female applicants in specific age brackets within weeks of deployment, triggered by a seemingly unrelated change to a credit-history data pipeline. Standard monitoring misses this entirely. FairnessDriftDetector, monitoring the metric stream with a statistical battery, flags the anomaly within the same weekly reporting cycle. The responsible ML team investigates, identifies the pipeline change, and issues a hotfix — before the drift compounds into a material fair-lending violation.
Healthcare — Readmission Risk Scoring
A hospital network's readmission model may appear fair at aggregate level while gradually assigning lower risk scores to Black and Hispanic patients in rural areas — reducing their access to preventive care. TemporalFairnessAnalyzer tracks this as a slow upward trend in false negative rate over weeks, invisible in day-to-day dashboards. The intersectional alert fires at the group-level combination (race × geography), routing to the clinical equity team with sufficient lead time to intervene before the disparity widens further.
E-Commerce — Recommendation Engine
A recommendation platform may see recommendation diversity for women in high-margin product categories erode by 30% over six months through a long-term feedback loop — completely invisible in aggregate click-through metrics. Multi-scale temporal analysis decomposes the fairness metric time series across hourly, weekly, and quarterly scales, making the quarterly trend visible. A ride-sharing company that implemented adaptive thresholds for pricing fairness achieved an 80% reduction in false-positive alerts while tripling detection speed for genuine bias patterns.
Organisational Readiness Checklist
| Readiness Area | Minimum Viable | Production-Grade |
|---|---|---|
| Data retention | 30 days of prediction logs with protected-attribute labels | 90+ days; enables meaningful trend and seasonality detection |
| Compute budget | Group-level sliding-window metrics add ~5–10% to serving cost | Dedicated async compute for intersectional and temporal analysis |
| Alert routing | Email to the model owner | Tiered routing: Jira (LOW) → Slack (HIGH) → PagerDuty (CRITICAL) |
| Escalation path | Data science team reviews weekly | Defined SLA per severity; legal team notified for CRITICAL events |
| Feedback loop | Manual threshold tuning quarterly | AdaptiveThresholdManager updates thresholds from operator feedback continuously |
BiasDetector or post-processing step. See the Production Monitoring section of the API Reference for constructor parameters, method signatures, and end-to-end code examples.
Part 8 — Workflow Integration
Fairness checks must be embedded into the development lifecycle, not bolted on afterwards. Without automated enforcement, fairness requirements decay as teams ship under pressure.
CI/CD Fairness Gates
vfairness provides automated deployment gates that block model releases when fairness thresholds are violated. These integrate with GitHub Actions, GitLab CI, and any orchestrator that supports Python scripts.
| Component | What It Does | Business Value |
|---|---|---|
| ModelFairnessGate | Evaluates model predictions against configurable fairness thresholds and produces a pass/fail decision | Prevents discriminatory models from reaching production |
| Hierarchical Checking | Three-level evaluation: overall → single-attribute → intersectional. Catches harm hidden in subgroups | A model that is “fair overall” may still discriminate against specific intersections (e.g., older women) |
| FairnessReportCard | Generates a structured PR comment with pass/fail badges, metric tables, and recommendations | Every reviewer sees fairness evidence before approving a merge |
| Small-Sample Warnings | Flags groups with insufficient data to produce statistically reliable fairness metrics | Prevents false confidence in groups too small to measure accurately |
MLOps Experiment Tracking
Fairness metrics should live alongside accuracy metrics in your experiment tracker. vfairness supports two major platforms:
| Platform | Function | What Gets Logged |
|---|---|---|
| MLflow | log_fairness_to_mlflow() |
Metrics (prefixed), parameters, full fairness report as artifact |
| Weights & Biases | log_fairness_to_wandb() |
Metrics (prefixed), group-level statistics, full report as W&B artifact |
| Auto-logging | @auto_log_fairness |
Decorator that wraps any training function and logs fairness metrics to the active MLflow or W&B run |
With experiment tracking in place, teams can compare fairness across model versions and catch regressions before they escape to production.
Developer Workflow Tools
vfairness embeds fairness into the daily developer workflow through three mechanisms:
- Pre-commit hooks — Verify that fairness configuration files exist and that model cards include a fairness section before code can be committed. Catches missing documentation at the earliest possible moment.
- pytest plugin — The
@pytest.mark.fairnessmarker andfairness_gatefixture let teams write fairness tests that run alongside unit tests. A dedicated terminal summary shows fairness results at the end of each test run. - PR templates — A built-in pull request template with a fairness checklist ensures reviewers ask the right questions: protected attributes identified? Thresholds documented? Intersectional analysis performed?
Part 6 — Reporting & Dashboards
Monitoring data only creates value when it is communicated effectively to the right audience. An executive needs a single traffic-light indicator, an engineer needs trend charts with drill-down, and an auditor needs full statistical tables.
Use vfairness.operations.reporting when you need to:
- Present fairness results to stakeholders with different levels of technical expertise
- Generate compliance-ready audit documentation automatically
- Protect sensitive demographic data while still enabling analysis
- Allow executives to explore "what-if" scenarios interactively
Architecture Overview
flowchart LR
A["Monitoring
(Part 5)"] --> B["MetricsStore
Privacy Layer"]
B --> C["FairnessDashboard
Plotly Charts"]
B --> D["ReportGenerator
HTML / Markdown / JSON"]
B --> E["InteractiveDashboard
Dash App / Standalone HTML"]
C --> F["Executive Tier 1"]
C --> G["Operational Tier 2"]
C --> H["Technical Tier 3"]
style A fill:#059669,color:#fff
style B fill:#7c3aed,color:#fff
style C fill:#7c3aed,color:#fff
style D fill:#7c3aed,color:#fff
style E fill:#7c3aed,color:#fff
| Component | Class | Purpose |
|---|---|---|
| Data Layer | MetricsStore |
Unified ingestion & privacy-preserving query API |
| Visualization | FairnessDashboard |
Plotly-based progressive-disclosure dashboards |
| Reporting | ReportGenerator |
Multi-tier, multi-format automated reports with NLG |
| Interactivity | InteractiveDashboard |
Dash app or standalone HTML with what-if analysis |
MetricsStore & Privacy Protection
The MetricsStore is the single source of truth for all fairness metrics. It ingests data from every upstream monitoring component and applies a three-tier privacy protection scheme before any metric is surfaced to consumers.
Three-Tier Privacy Scheme
| Tier | Condition | Treatment | Purpose |
|---|---|---|---|
| Suppressed | Group size < k | NaN (hidden) | k-anonymity — prevents identification of small groups |
| Noisy | k ≤ group size < noise threshold | Calibrated Laplace noise (ε-DP) | Differential privacy — plausible deniability for borderline groups |
| Exact | Group size ≥ noise threshold | No modification | Statistically stable groups reported as-is |
Fairness metrics inherently reveal information about protected groups. Without privacy safeguards, a dashboard showing that "3 people in Group X were denied" could enable re-identification. The three-tier scheme ensures compliance with GDPR Article 25 (data protection by design) and the EU AI Act transparency requirements.
How the Three Tiers Work
The privacy scheme is applied automatically whenever metrics are queried from the store. Each record carries the group size — the number of individuals in the demographic subgroup the metric describes. This group size determines which tier applies:
- Suppression (k-anonymity). If a subgroup has fewer than k members (default: 10), the metric value is replaced with
NaN. This prevents re-identification: if only 3 people belong to "non-binary, age 60+", reporting their exact approval rate could reveal individual outcomes. The threshold follows Sweeney's k-anonymity model (2002) and satisfies GDPR Article 25 (data protection by design). - Noise injection (differential privacy). If a subgroup has between k and a noise threshold (default: 50) members, calibrated Laplace noise is added to the metric value. The noise magnitude is governed by the privacy budget ε (default: 1.0) — smaller ε means more noise and stronger privacy. This follows the ε-differential privacy framework of Dwork et al. (2006) and provides plausible deniability: an observer cannot determine whether any single individual's data influenced the reported metric.
- Exact reporting. Groups with 50+ members are large enough that individual contributions are naturally diluted. Their metrics are returned without modification.
Configuration Parameters
| Parameter | Default | Business Guidance |
|---|---|---|
k_anonymity_threshold |
10 | Raise for high-risk domains (healthcare, criminal justice). GDPR and the EU AI Act do not prescribe a specific k, but ICO guidance suggests k ≥ 5 as minimum. |
noisy_threshold |
50 | Groups between k and this value receive Laplace noise. Increase if your smallest reportable subgroups are larger. |
dp_epsilon |
1.0 | Privacy budget. Values ≤ 1.0 are considered strong privacy; 0.1 is very conservative. Values > 10 offer weak protection. Consult your DPO when adjusting. |
enable_privacy |
True |
Master switch. Set to False only for internal debugging. Must be True for any report shared externally. |
Regulatory Compliance Mapping
| Regulation | Requirement | How vfairness Addresses It |
|---|---|---|
| GDPR Art. 25 | Data protection by design and by default | Privacy is on by default (enable_privacy=True); small groups are automatically suppressed |
| GDPR Art. 35 | Data Protection Impact Assessment | Three-tier scheme provides documented, auditable privacy safeguards for DPIA evidence |
| EU AI Act Art. 9 | Risk management for high-risk AI | Prevents fairness dashboards from becoming a secondary privacy risk |
| EU AI Act Art. 10(5) | Processing of special categories with safeguards | Differential privacy and k-anonymity provide the "appropriate safeguards" for processing sensitive attributes |
Capabilities
- Multi-source ingestion — accepts snapshots from
FairnessMonitor,TemporalFairnessAnalyzer,FairnessDriftDetector, andFairnessAlertPrioritizer - Composite health score — a single 0–100 number summarizing overall fairness posture
- Time-series queries — retrieve metric histories with confidence intervals for trend analysis
- History pruning — configurable retention window (default: 365 days) to limit storage costs
- Master privacy switch — disable privacy for internal/debug use, re-enable for production
Progressive-Disclosure Dashboards
The FairnessDashboard transforms raw metrics into actionable Plotly visualizations with three audience-specific tiers:
Tier 1 — Executive
A single health-score gauge and three traffic-light KPI cards. Designed for C-suite briefings and board reports — answers "are we compliant?" in under five seconds.
Tier 2 — Operational
A 2×2 grid with trend charts, disparity bar charts, alert timelines, and NLG annotation overlays. For product managers and ML engineers during sprint reviews.
Tier 3 — Technical
Full statistical tables, intersectional heatmaps, confidence intervals, and drill-down into individual predictions. For data scientists and auditors requiring complete evidence.
flowchart TB
subgraph "Progressive Disclosure"
T1["Tier 1
Health Score + 3 KPIs"] --> T2["Tier 2
Trend + Disparity + Alerts"]
T2 --> T3["Tier 3
Full Tables + Heatmaps"]
end
E["Executive"] --> T1
P["Product Manager"] --> T2
D["Data Scientist / Auditor"] --> T3
style T1 fill:#7c3aed,color:#fff
style T2 fill:#7c3aed,color:#fff
style T3 fill:#7c3aed,color:#fff
Automated Report Generation
The ReportGenerator produces stakeholder-specific reports in HTML, Markdown, or JSON — triggered by events (threshold breaches, drift detection) or on a schedule.
| Feature | Description |
|---|---|
| Tier-Matched Content | Executive reports get a one-paragraph summary; technical reports get full confusion matrices |
| Natural Language Generation | Converts statistical results into readable English explanations |
| Chart Embedding | Plotly charts rendered inline in HTML reports — no external dependencies |
| Multi-Format Output | HTML for email/web, Markdown for version control, JSON for API integration |
| Event-Driven Triggers | Generate a report automatically when a CRITICAL alert fires or a drift event is detected |
| Model Version Tracking | Metadata captures which model version produced the metrics in each report |
Automated reports replace manual audit preparation, reducing compliance documentation time from days to minutes. Each report is timestamped, versioned, and reproducible — satisfying EU AI Act Article 12 (record-keeping) and Article 13 (transparency).
Interactive What-If Analysis
The InteractiveDashboard provides the deepest level of exploration, operating in two modes:
Dash Application Mode
Full server-side application with live sidebar filters (metric selector, date range, group checklist) and real-time chart updates. Best for internal teams with Jupyter or server infrastructure.
Standalone HTML Mode
Pre-rendered, self-contained HTML with embedded JavaScript. Works offline with no server — ideal for sharing with external auditors or attaching to regulatory submissions.
Interactive Capabilities
- Metric selector dropdown — switch between demographic parity, equal opportunity, calibration, etc.
- Date range filter — zoom into specific monitoring windows
- Group filtering — include/exclude demographic groups from the analysis
- What-if threshold slider — adjust classification thresholds and see fairness impact in real time
- Confidence interval ribbons — convey statistical uncertainty on every trend line
Even in the interactive dashboard, groups below the minimum display-size threshold are suppressed. Confidence intervals widen for smaller groups, visually communicating the reduced certainty to the user.
Part 7 — Experimentation
Traditional A/B tests optimize a single metric. Fairness A/B tests navigate multi-dimensional optimization across demographic groups — ensuring that an intervention that helps one group does not harm another.
Use vfairness.operations.experimentation when you need to:
- Evaluate whether a new model or policy improves fairness before full deployment
- Ensure that experiments are adequately powered for every demographic intersection
- Navigate trade-offs between business KPIs (revenue, engagement) and fairness constraints
- Get automated, defensible deployment recommendations that balance multiple objectives
Architecture Overview
| Component | Class | Purpose |
|---|---|---|
| Core A/B Testing | FairnessExperiment |
Intersectional treatment-effect analysis with confidence intervals |
| Power Analysis | FairnessPowerAnalyzer |
Per-intersection power, SPRT early stopping, adaptive sampling |
| Multi-Objective Analysis | ExperimentAnalysis |
Pareto frontier, mediation, CATE, temporal stability, recommendations |
flowchart LR
D["Design
Experiment"] --> R["Run
FairnessExperiment"]
R --> P["Assess Power
FairnessPowerAnalyzer"]
P --> A["Analyse
ExperimentAnalysis"]
A --> Dec{"Decision
Recommendation"}
Dec -->|Deploy| Dep["Deploy Treatment"]
Dec -->|Keep| Keep["Keep Control"]
Dec -->|Extend| Ext["Extend Experiment"]
Dec -->|Investigate| Inv["Investigate Further"]
style R fill:#dc2626,color:#fff
style P fill:#dc2626,color:#fff
style A fill:#dc2626,color:#fff
style Dec fill:#dc2626,color:#fff
Fairness-Aware A/B Testing
FairnessExperiment extends standard A/B testing by automatically enumerating every demographic intersection and computing treatment effects for each. A standard test might report "overall approval rate increased by 3%" — a fairness test also reports that the increase was +5% for Group A but −1% for Group B.
Key Capabilities
- Automatic intersection enumeration — all combinations of protected attributes (e.g., gender × race × age group) are analysed without manual specification
- Per-intersection confidence intervals — bootstrap CIs for each demographic subgroup, not just the aggregate
- Heterogeneity testing — ANOVA / Kruskal-Wallis tests detect whether the treatment effect varies significantly across groups
- Multiple comparison correction — Bonferroni and Benjamini-Hochberg FDR corrections prevent false positives when testing many intersections
- Flexible designs — simple A/B, stratified randomization, cluster randomization, and full factorial designs
Experimental Design Options
| Design | When to Use | Example |
|---|---|---|
| Simple A/B | Independent users, no interference concerns | Online loan applications |
| Stratified | Ensure balanced representation per group | Clinical trials with rare demographics |
| Cluster Randomization | Users influence each other (network effects) | Marketplace experiments, school-level interventions |
| Factorial | Test multiple interventions simultaneously | Model A × Threshold strategy B |
Research consistently shows that aggregate treatment effects hide divergent impacts on subgroups (Athey & Imbens, 2016). A model that improves fairness on average may worsen outcomes for specific intersections. Always inspect per-intersection results before making deployment decisions.
Power Analysis per Intersection
Standard power analysis asks: "Is my experiment large enough to detect an overall effect?" Fairness power analysis asks: "Is my experiment large enough to detect effects for every demographic intersection?"
This distinction matters because small intersections (e.g., elderly Hispanic women) are exactly the groups most at risk of unfair treatment — and the groups most likely to be underpowered in a standard experiment.
Capabilities
| Feature | Description | Business Benefit |
|---|---|---|
| Per-Intersection Power | Computes statistical power for each demographic subgroup separately | Prevent decisions based on underpowered groups |
| Required Sample Size | Calculates how many observations each group needs to reach target power (0.80) | Plan experiment duration and budget accurately |
| Minimum Detectable Effect | Given current data, what is the smallest effect each group can detect? | Understand sensitivity limitations before interpreting results |
| SPRT Early Stopping | Sequential Probability Ratio Test enables continuous monitoring | Stop experiments early when evidence is conclusive — saving time and cost |
| Adaptive Sampling | Allocate additional sample budget to the most underpowered intersections first | Maximize information per observation, especially for rare groups |
A lending company tests a new fairness-aware approval model. The overall experiment is well-powered (power = 0.95), but FairnessPowerAnalyzer reveals that the "Black × Female" intersection has only power = 0.35 — meaning a genuine improvement for this group has a 65% chance of going undetected. The adaptive sampling plan shifts budget to recruit more applicants in this group.
Multi-Objective Optimization
Real-world deployment decisions rarely hinge on a single metric. The ExperimentAnalysis class computes the Pareto frontier across multiple objectives — typically fairness vs. business KPIs — so decision-makers can see the full trade-off space.
Pareto Frontier
The Pareto frontier identifies experiment variants where no objective can be improved without worsening another. Points below the frontier are dominated — there exists another variant that is better on all dimensions simultaneously.
flowchart TB
subgraph "Pareto Trade-off Space"
direction TB
P1["Variant A
High Revenue
Low Fairness"]
P2["Variant B
Balanced
(Pareto Optimal)"]
P3["Variant C
High Fairness
Lower Revenue"]
P4["Variant D
Dominated
(Worse on Both)"]
end
P1 --- P2
P2 --- P3
P4 -.->|"Dominated by B"| P2
style P2 fill:#dc2626,color:#fff
style P4 fill:#ccc,color:#666
Additional Analysis Capabilities
| Analysis | Method | What It Reveals |
|---|---|---|
| Mediation Analysis | Baron & Kenny framework | How much of the treatment effect flows through intermediate variables (e.g., "the model improves fairness because it reduces reliance on ZIP code") |
| Heterogeneous Treatment Effects | Conditional Average Treatment Effect (CATE) | Effect size for each demographic intersection — identifies who benefits most and who may be harmed |
| Temporal Stability | Time-window analysis | Whether treatment effects remain stable over time or degrade (e.g., seasonal effects, user adaptation) |
| Spillover Detection | Cluster-level interference check | Whether treatment and control groups are influencing each other (critical for marketplace experiments) |
Automated Decision Recommendations
The ExperimentAnalysis.decision_recommendation() method synthesizes all analysis results into a single, defensible recommendation with four possible outcomes:
Deploy Treatment
The treatment improves fairness outcomes with acceptable business trade-offs. All key intersections are adequately powered and show consistent positive effects.
Keep Control
The treatment does not improve outcomes or introduces unacceptable trade-offs. The current model remains preferable.
Extend Experiment
Results are promising but key intersections are underpowered. More data is needed for a confident decision.
Investigate Further
Heterogeneous effects or anomalies detected. Some groups benefit while others are harmed — requires deeper analysis before any deployment.
Each recommendation includes:
- Confidence score — how certain the system is in the recommendation (0–100%)
- Reasoning chain — step-by-step justification referencing specific metrics and thresholds
- Trade-offs — what is gained and what is lost under each scenario
- Caveats — limitations of the analysis (underpowered groups, data quality, external validity)
Automated recommendations replace ad-hoc "gut feel" deployment decisions with structured, auditable reasoning. Each recommendation is fully reproducible and can be attached to regulatory submissions as evidence of due diligence.
Business Scenarios
| Industry | Experiment | Key Question |
|---|---|---|
| Financial Services | New credit-scoring model vs. legacy | Does the new model reduce approval-rate disparity without increasing default rates? |
| Healthcare | Fair risk-prediction model for triage | Do all demographic groups receive equally accurate risk assessments? |
| E-Commerce | Debiased recommendation algorithm | Does the new algorithm improve exposure equity without reducing conversion? |
| Employment | Fair resume-screening model | Does the intervention equalize interview callback rates across demographic groups? |
| Insurance | Recalibrated pricing model | Are premiums calibrated equally well for all groups without cross-subsidization? |
Glossary
A comprehensive, alphabetical reference of key terms and concepts in AI fairness, bias detection, algorithmic accountability, monitoring, reporting, and experimentation.
| Term | Definition | Also Known As / Notes |
|---|---|---|
| Adverse Action Notice | A notice required when a consumer is denied credit or other benefits, explaining the principal reasons for the adverse decision. | US regulation (ECOA, FCRA) |
| Affirmative Action | Policies that explicitly consider protected attributes to achieve more equitable outcomes, sometimes used as a bias mitigation technique. | Positive Discrimination (UK) |
| Aggregation Bias | Using a single model for groups that have different underlying data distributions or relationships. E.g., one diabetes model for populations with different disease presentations. | Simpson's Paradox (related) |
| Algorithmic Accountability | The principle that organizations deploying automated decision systems should be responsible for their outcomes and able to explain and justify their decisions. | Emerging globally |
| Algorithmic Fairness | The study and practice of ensuring automated decision systems treat individuals and groups equitably, without causing unjustified harm to protected populations. | AI Fairness, ML Fairness |
| Audit | A systematic evaluation of a model's fairness across multiple dimensions, groups, and metrics to identify and document potential biases. | Fairness Audit, Bias Audit |
| Automation Bias | The tendency of humans to over-rely on automated systems, even when they produce errors. E.g., judges following algorithmic recommendations without scrutiny. | Algorithm Aversion (opposite) |
| Base Rate | The underlying prevalence of a condition or outcome in a population. Different base rates across groups can make some fairness metrics impossible to satisfy simultaneously. | Prior Probability, Prevalence |
| Bootstrap | A resampling method that estimates the sampling distribution by drawing repeated samples with replacement from the original data. Used to calculate confidence intervals for fairness metrics. | Typically 1,000–10,000 iterations |
| Calibration | When predicted probabilities match actual outcome rates across groups. A well-calibrated model with 70% predicted probability should have approximately 70% actual positive rate for all groups. | Test Fairness, Matching Conditional Frequencies |
| CATE | Conditional Average Treatment Effect — the treatment effect for a specific subgroup. In fairness experiments, CATE is computed per demographic intersection to detect heterogeneous impacts. | Heterogeneous Treatment Effect, HTE |
| Cluster Randomization | An experimental design where groups of users (clusters) rather than individuals are assigned to treatment/control. Used when users can influence each other (e.g., marketplace, social network, school). | Cluster-Randomized Trial, CRT |
| Confidence Interval (CI) | A range of values that likely contains the true parameter value, given the observed data. Provides a measure of uncertainty around point estimates of fairness metrics. | Usually 95% or 99% CI |
| Confirmation Bias | Tendency to search for or interpret information in a way that confirms preexisting beliefs. E.g., evaluating model fairness only on metrics that look favorable. | — |
| Confusion Matrix | A table showing the counts of True Positives (TP), False Positives (FP), True Negatives (TN), and False Negatives (FN). Forms the basis for calculating many fairness metrics. | Error Matrix, Contingency Table |
| Counterfactual Fairness | A causal approach where an individual's prediction would remain the same in a counterfactual world where their protected attribute was different. | Causal Fairness |
| Data & Preprocessing | Fairness-aware feature transforms and pre-training bias auditing applied to training data before model training, such as reweighting, resampling, or transforming features. | Pre-processing Interventions |
| Demographic Parity | The requirement that each group receives positive predictions at the same rate, regardless of the actual outcome. A model satisfies demographic parity if P(Ŷ=1|A=0) = P(Ŷ=1|A=1). | Statistical Parity, Independence, Group Fairness |
| Differential Privacy | A mathematical framework guaranteeing that the inclusion or exclusion of any single individual does not materially change the output of a computation. vfairness applies calibrated Laplace noise (ε-DP) to borderline groups. | ε-DP, DP |
| Disparate Impact | Unintentional discrimination where a neutral policy or practice disproportionately affects a protected group. Measured by the four-fifths rule: a selection rate for a protected group less than 80% of the most favored group indicates potential adverse impact (values below 0.8). | Four-Fifths Rule, Adverse Impact Ratio, 80% Rule |
| Disparate Treatment | Intentional discrimination based on protected attributes. The model explicitly uses protected attributes to make different decisions for different groups. | Direct Discrimination |
| Drift Detection | The process of detecting statistically meaningful changes in fairness metrics over time in production. Distinguishes genuine fairness degradation from normal operational noise using statistical tests such as sequential probability ratio tests and distribution shift scoring. | Fairness Drift, Model Drift |
| ECOA | Equal Credit Opportunity Act prohibiting discrimination in credit decisions based on race, color, religion, national origin, sex, marital status, age, or public assistance receipt. | United States |
| EEOC Guidelines | US Equal Employment Opportunity Commission guidelines including the four-fifths (80%) rule for assessing adverse impact in employment decisions. | United States |
| Effect Size | A standardized measure of the magnitude of a difference, independent of sample size. Helps assess practical significance beyond statistical significance. | Small: 0.2, Medium: 0.5, Large: 0.8 (Cohen's d) |
| Equal Opportunity | The requirement that qualified individuals from different groups have equal chances of receiving a positive prediction. Formally: equal True Positive Rates across groups. | Equality of Opportunity, TPR Parity |
| Equalized Odds | A stricter criterion requiring both True Positive Rates (TPR) and False Positive Rates (FPR) to be equal across groups. Ensures both qualified and unqualified individuals are treated equally. | Separation, Conditional Procedure Accuracy |
| EU AI Act | European Union regulation establishing requirements for AI systems based on risk level, including mandatory fairness assessments for high-risk applications. | European Union |
| Explainability | The ability to understand and articulate why a model made a particular prediction, important for identifying sources of bias and ensuring accountability. | Interpretability, XAI |
| Fair Housing Act | US law prohibiting discrimination in housing-related decisions based on race, color, national origin, religion, sex, familial status, or disability. | United States |
| Fairness A/B Test | A controlled experiment that evaluates treatment effects not just in aggregate but for every demographic intersection. Detects cases where an intervention helps one group while harming another. | Intersectional Experiment |
| Fairness Constraint | A mathematical requirement imposed during model training or at prediction time to ensure the model satisfies a particular fairness criterion. | Fairness Regularizer |
| Fairness Gerrymandering | A situation where a model appears fair on aggregate metrics but exhibits discrimination against specific subgroups. Highlights the importance of intersectional analysis. | Subgroup Unfairness |
| Fairness-Accuracy Trade-off | The common observation that improving fairness metrics often comes at some cost to overall accuracy, though the magnitude depends on the specific context and approach. | Pareto Trade-off |
| False Negative Rate (FNR) | Among actual positives, the proportion incorrectly predicted as negative. Measures missed positive cases. | Miss Rate; 0–1 (lower is better) |
| False Positive Rate (FPR) | Among actual negatives, the proportion incorrectly predicted as positive. Measures the rate of false alarms. | Fall-out; 0–1 (lower is better) |
| Feature | An input variable used by a model to make predictions. Features can be direct (age), derived (income-to-debt ratio), or learned (neural network embeddings). | Predictor, Input Variable |
| GDPR | General Data Protection Regulation requiring transparency in automated decision-making and giving individuals the right to explanation and human review. | European Union |
| Ground Truth | The actual correct outcome or label used to evaluate model predictions (e.g., whether a borrower actually defaulted, whether an applicant succeeded in the job). | Label, Target Variable |
| Historical Bias | Bias present in the data due to past discrimination or societal inequities that the model learns and perpetuates. E.g., hiring data reflecting decades of gender discrimination in tech. | Societal Bias |
| Impossibility Theorem | A fundamental result showing that certain fairness criteria (e.g., calibration, equal TPR, equal FPR) cannot all be satisfied simultaneously except in trivial cases. Forces practitioners to make explicit trade-off decisions. | Chouldechova (2017), Kleinberg et al. (2016) |
| Individual Fairness | The principle that similar individuals should receive similar predictions. Requires a meaningful similarity metric to define "similar" in the relevant context. | Fairness Through Awareness, Lipschitz Fairness |
| Intersectionality | The interconnected nature of social categorizations that create overlapping systems of discrimination. Recognizes that individuals belong to multiple groups simultaneously (e.g., Black women may face unique challenges not captured by race-only or gender-only analysis). | Intersectional Analysis |
| k-Anonymity | A privacy guarantee that ensures each record is indistinguishable from at least k−1 other records. In vfairness, groups smaller than k have their metrics suppressed to prevent re-identification. | Group Suppression |
| Label Bias | When the ground truth labels themselves reflect human bias or are systematically inaccurate for certain groups. E.g., arrest records as proxy for crime (reflects policing bias). | Outcome Bias |
| Measurement Bias | When the features or labels used to train a model are measured differently or less accurately for certain groups. E.g., credit scores being less predictive for immigrants with short credit history. | Instrument Bias |
| Mediation Analysis | A statistical method (Baron & Kenny framework) that decomposes a treatment effect into direct and indirect (mediated) pathways — explaining why an intervention works, not just that it works. | Causal Decomposition, Path Analysis |
| MetricsStore | A unified data layer that ingests fairness metrics from all monitoring components and applies privacy protections (k-anonymity, differential privacy) before exposing data to consumers. | Metrics Repository, Data Layer |
| Model Card | A documentation framework providing essential information about a machine learning model, including its intended use, performance, limitations, and fairness evaluations. | Mitchell et al. (2019) |
| Multiple Comparison Correction | Statistical adjustments (Bonferroni, FDR) that control the false-positive rate when testing many intersections simultaneously. Without correction, testing 20 groups at α=0.05 virtually guarantees at least one false positive. | Bonferroni Correction, Benjamini-Hochberg FDR |
| Negative Predictive Value (NPV) | Among predicted negatives, the proportion that are actually negative. | 0–1 (higher is better) |
| NLG (Natural Language Generation) | The automated conversion of structured data (metrics, statistics) into readable English paragraphs. Used by ReportGenerator to make fairness results accessible to non-technical stakeholders. |
Automated Narration |
| P-Value | The probability of observing the data (or more extreme) if the null hypothesis is true. Lower values suggest the result is unlikely due to chance. | p < 0.05 typically significant |
| Pareto Frontier | The set of experiment variants where no objective (e.g., revenue, fairness) can be improved without worsening another. Variants below the frontier are "dominated" — strictly worse on all dimensions. | Pareto Optimal Set, Efficient Frontier |
| Positive Predictive Value (PPV) | Among predicted positives, the proportion that are actually positive. Also called precision. | Precision; 0–1 (higher is better) |
| Prediction-Time Interventions | Bias mitigation techniques applied at prediction time, such as group-specific calibration, adjusting decision thresholds per group, or prediction reweighting. | Post-processing Interventions |
| Predictive Parity | The requirement that Positive Predictive Value (PPV/precision) is equal across groups. When satisfied, a positive prediction has the same meaning regardless of group membership. | Outcome Test, Sufficiency, PPV Parity |
| Progressive Disclosure | A dashboard design pattern where information is presented in tiers of increasing detail — from executive summaries to full technical tables — so each stakeholder sees the right level of granularity. | Tiered Reporting |
| Protected Attribute | A characteristic that defines groups protected from discrimination under law or ethics, such as race, gender, age, religion, disability, or national origin. | Sensitive Attribute, Protected Class |
| Proxy Variable | A feature that correlates with a protected attribute and can enable indirect discrimination even when the protected attribute is not directly used. Examples: ZIP code as proxy for race, name as proxy for gender. | Indirect Feature, Redundant Encoding |
| Reductions Approach | A training-time fairness method that converts a constrained optimization problem into a sequence of cost-sensitive classification subproblems. The algorithm iteratively reweights samples to satisfy fairness constraints. | Exponentiated Gradient, Agarwal et al. (2018) |
| Representation Bias | Occurs when certain groups are underrepresented or overrepresented in training data compared to the target population. E.g., medical datasets with few minority patients. | Population Bias |
| Right to Explanation | The legal right for individuals to receive meaningful information about the logic involved in automated decisions that significantly affect them. | EU, Various jurisdictions |
| Sampling Bias | When the data collection process systematically excludes or undersamples certain populations. E.g., survey data missing low-income households without internet. | Collection Bias |
| Selection Bias | When the observed data is not representative because of how subjects were selected into the dataset. E.g., loan performance data missing rejected applicants. | Survivorship Bias (related) |
| SPRT | Sequential Probability Ratio Test — a method for continuously monitoring experiment results and stopping early when the evidence for or against the treatment is conclusive. Reduces experiment duration and cost. | Sequential Testing, Early Stopping |
| Statistical Power | The probability of correctly detecting an effect when it truly exists (1−β). Higher power requires larger sample sizes. vfairness computes power per demographic intersection, not just overall. Recommended minimum: 0.8 (80%). | 1 − β; Sensitivity of a test |
| Threshold | A cutoff value used to convert predicted probabilities into binary decisions. Adjusting thresholds per group is one method for achieving certain fairness criteria (e.g., equalized odds). | Decision Boundary, Cutoff |
| Training-Time Interventions | Bias mitigation techniques applied during model training by adding fairness constraints or regularization terms to the learning objective. Includes reductions approaches and Lagrangian methods. | In-processing Interventions |
| Treatment Effect | The measured difference in outcomes between the treatment group (new model/policy) and the control group (existing model/policy). | ATE (Average Treatment Effect) |
| True Negative Rate (TNR) | Among actual negatives, the proportion correctly predicted as negative. | Specificity; 0–1 (higher is better) |
| True Positive Rate (TPR) | Among actual positives, the proportion correctly predicted as positive. Measures how well the model identifies positive cases. | Recall, Sensitivity; 0–1 (higher is better) |
| What-If Analysis | An interactive exploration mode where users adjust parameters (e.g., classification thresholds) and see the impact on fairness metrics in real time, without re-running the model. | Scenario Analysis, Sensitivity Analysis |
Appendices
Appendix A: Regulatory Quick Reference
Key regulations affecting AI fairness by jurisdiction and sector.
Coming Soon — See EU AI Act References and Swiss References for current coverage.
Appendix B: Metric Formulas
Mathematical definitions of all fairness metrics.
Coming Soon — See Classification Metrics and Regression Metrics in the API Reference for current metric documentation.
Appendix C: Sample Audit Report
Example of a complete fairness audit report.
Coming Soon — See the Bias Detection tutorial for a worked audit example.