A fairness metric is a mathematical definition that operationalizes a specific ethical principle, such as demographic parity or equalized odds, into a calculable formula. It provides a rigorous, statistical method for auditing a machine learning model's behavior by comparing outcomes—like approval rates or error rates—between a privileged group and an unprivileged group defined by a protected attribute. These metrics translate abstract legal concepts of non-discrimination into verifiable technical constraints within a model evaluation pipeline.
Glossary
Fairness Metric

What is a Fairness Metric?
A fairness metric is a quantitative measure used to evaluate and compare model prediction outcomes across different protected demographic groups to detect and mitigate algorithmic bias.
Selecting the correct metric requires a trade-off analysis, as many fairness definitions are mathematically incompatible; optimizing for demographic parity may violate equalized odds, and vice versa. The metric is calculated on a test dataset segmented by sensitive attributes, with a perfectly fair model achieving a score of zero disparity. Common thresholds, such as the disparate impact ratio falling below 0.8, are used to flag potential regulatory non-compliance before a model is deployed in high-stakes domains like lending or hiring.
Key Types of Fairness Metrics
Fairness metrics are mathematical formalizations of ethical constraints, each designed to detect a specific type of statistical disparity in model predictions across protected demographic groups.
Demographic Parity
Also known as statistical parity, this metric requires the probability of a positive prediction to be identical across all groups.
- Constraint: P(ŷ=1 | A=a) = P(ŷ=1 | A=b)
- Use Case: Loan approval where access to opportunity should be equalized.
- Weakness: Ignores the ground truth. It can force the model to approve unqualified applicants in one group to match the approval rate of a more qualified group, a phenomenon known as levelling down.
Equalized Odds
This metric requires the model to have equal True Positive Rates and False Positive Rates across groups, conditioning on the actual outcome.
- Constraint: P(ŷ=1 | Y=1, A=a) = P(ŷ=1 | Y=1, A=b) AND P(ŷ=1 | Y=0, A=a) = P(ŷ=1 | Y=0, A=b)
- Use Case: Criminal recidivism prediction where both false alarms and missed risks must be balanced.
- Advantage: Matches error rates to actual outcomes, avoiding the levelling down problem of demographic parity.
Equality of Opportunity
A relaxation of equalized odds, this metric focuses solely on equalizing the True Positive Rate across groups.
- Constraint: P(ŷ=1 | Y=1, A=a) = P(ŷ=1 | Y=1, A=b)
- Use Case: College admissions where the goal is to ensure equally qualified candidates from different groups have the same chance of admission.
- Distinction: It permits differences in false positive rates, meaning it only guarantees fairness for the 'advantaged' outcome class.
Predictive Parity
Also called test-fairness, this metric requires the model's positive predictive value (precision) to be equal across groups.
- Constraint: P(Y=1 | ŷ=1, A=a) = P(Y=1 | ŷ=1, A=b)
- Use Case: Targeted marketing where the cost of a false positive is high and the business needs to ensure a predicted conversion is equally reliable regardless of demographic.
- Trade-off: It is mathematically impossible to satisfy both predictive parity and equalized odds simultaneously unless the base rates of the outcome are identical across groups.
Individual Fairness
A philosophical departure from group metrics, this principle mandates that similar individuals should receive similar predictions.
- Formalization: D( f(x_i), f(x_j) ) ≤ d(x_i, x_j) for a task-specific distance metric
d. - Challenge: Requires defining a fairness metric that accurately captures task-relevant similarity, which is often a complex ontological problem.
- Contrast: Addresses the fairness gerrymandering problem where group metrics are satisfied by giving positive outcomes to one subset of a group and negative to another.
Disparate Impact Ratio
A legal metric derived from the 80% rule in US employment law, measuring the ratio of favorable outcomes for a protected group relative to a reference group.
- Calculation: (Selection Rate for Protected Group) / (Selection Rate for Reference Group)
- Threshold: A ratio below 0.8 indicates potential adverse impact.
- Application: Used in hiring algorithms to flag legally actionable discrimination before deployment.
Frequently Asked Questions
Precise answers to common technical questions about selecting, calculating, and interpreting fairness metrics in machine learning pipelines.
A fairness metric is a quantitative measure used to evaluate and compare model prediction outcomes across different protected demographic groups. It works by applying a specific mathematical definition of fairness—such as demographic parity or equalized odds—to a confusion matrix segmented by group membership. The metric calculates a ratio or difference between groups, producing a scalar value that indicates the presence and magnitude of disparity. For example, demographic parity requires the positive prediction rate to be equal across groups, while equalized odds demands equal true positive and false positive rates. These metrics are computed on a holdout evaluation dataset and serve as operationalized constraints during model selection, hyperparameter tuning, or post-processing mitigation.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
A fairness metric is rarely used in isolation. These interconnected concepts form the technical and regulatory framework for evaluating and mitigating algorithmic bias.
Disparate Impact Ratio
The 80% rule or four-fifths rule is a legal benchmark originating from U.S. employment law. It calculates the ratio of the favorable outcome rate for a protected group to that of a reference group.
- Formula: (Selection Rate for Protected Group) / (Selection Rate for Reference Group)
- Threshold: A ratio below 0.80 signals potential adverse impact
- Use Case: Often the first statistical test in a fairness audit before applying more nuanced metrics like equalized odds
Equalized Odds
A stricter fairness criterion requiring that a model's true positive rate and false positive rate are equal across all protected groups. Unlike demographic parity, it conditions on the ground truth label.
- Constraint: The predictor must be independent of the sensitive attribute, given the actual outcome
- Trade-off: Satisfying equalized odds often reduces overall model accuracy, forcing an explicit calibration of the fairness-utility frontier
- Origin: Formalized by Hardt, Price, and Srebro in their 2016 NeurIPS paper
Demographic Parity
Also called statistical parity, this metric requires that the probability of receiving a positive prediction is identical across all demographic groups. It is a purely outcome-based measure that ignores ground truth labels.
- Strength: Simple to explain to regulators and does not require labeled truth data for the protected attribute
- Weakness: Can lead to levelling down—reducing outcomes for the advantaged group rather than improving them for the disadvantaged
- Legal Context: Aligns with disparate impact theory under Title VII of the Civil Rights Act
Counterfactual Explanation
A causal fairness technique that answers: What minimal change to this individual's features would flip the model's decision? It exposes whether a protected attribute is the decisive factor.
- Mechanism: Generates the closest counterfactual data point that receives a different prediction
- Fairness Application: If changing only the sensitive attribute (e.g., race or gender) alters the outcome, the model exhibits individual-level discrimination
- Tooling: Implemented in libraries like DiCE (Diverse Counterfactual Explanations) and Alibi
Bias Detection and Fairness
The broader discipline encompassing the identification and mitigation of statistical bias. Fairness metrics are the quantitative instruments within this practice.
- Detection Phase: Applying metrics like demographic parity, equalized odds, and predictive parity to sliced evaluation data
- Mitigation Strategies:
- Pre-processing: Reweighting or resampling training data
- In-processing: Adding fairness constraints to the loss function
- Post-processing: Calibrating decision thresholds per group
- Governance: Requires integration with model cards and algorithmic impact assessments for full regulatory compliance
Accuracy Parity
A fairness constraint mandating that the model's overall prediction accuracy is equal across demographic groups. It ensures no group systematically experiences higher error rates.
- Limitation: Accuracy parity can be satisfied even when the model exhibits significant differences in false positive and false negative rates between groups
- Complementary Metric: Must be used alongside equalized odds or predictive parity to catch masked disparities
- Example: A model with 90% accuracy for both groups might still deny loans to qualified minority applicants at twice the rate of majority applicants

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us