Conditional Demographic Parity in Machine Learning

The growing need for fairness in machine learning models stems from the increasing reliance on AI for decisions that impact people’s lives, from hiring and lending to healthcare and criminal justice. With these decisions often having profound consequences, ensuring that AI models do not unfairly discriminate against certain groups is essential.

However, traditional fairness metrics such as Demographic Parity can oversimplify the situation. Demographic Parity doesn’t account for the underlying reasons that might explain why certain groups are treated differently. For example, consider a credit scoring algorithm: while Demographic Parity might ensure that the same proportion of men and women receive loan approvals, it doesn’t consider whether women, on average, have lower credit scores due to socio-economic reasons, rather than any inherent bias in the model.

This is where Conditional Demographic Parity  (CDP) comes in. By conditioning on relevant explanatory attributes, CDP allows us to separate legitimate causes of disparity from potentially discriminatory ones. It offers a framework for identifying cases where the model may be unfairly penalising or favouring groups, even when accounting for contextual differences.

 

What is Conditional Demographic Parity?

At its core, Conditional Demographic Parity (CDP) is an extension of the more commonly known Demographic Parity (DP). While DP aims for equal treatment of different demographic groups by ensuring that the probability of receiving a positive prediction is the same across these groups, CDP takes this a step further by considering additional explanatory attributes. These attributes, often referred to as R, are variables that can help contextualize the decision being made by the model.

The principle behind CDP is that the proportion of unprivileged individuals receiving both favourable and unfavourable outcomes should be equal when conditioned on certain explanatory attributes. Mathematically, it’s expressed as:

Where:

  • G represents the group (privileged or unprivileged),
  • y^​ is the predicted outcome,
  • R represents the explanatory attribute, and
  • r is a particular value of the explanatory attribute.

By introducing these contextual attributes, CDP allows for a more nuanced view of fairness, one that considers the reasons behind differential treatment rather than simply grouping individuals based on broad demographic characteristics.

 

The Challenges of Implementing Conditional Demographic Parity

While the concept of Conditional Demographic Parity sounds promising, its implementation is far from straightforward. Over the years, I’ve had the opportunity to work on numerous AI fairness projects, and I’ve encountered several challenges that are worth highlighting for those leading AI initiatives.

1. Choosing the Right Explanatory Attributes

The first challenge in implementing CDP lies in determining which explanatory attributes (RRR) should be used to condition the fairness metric. These attributes need to be selected carefully, often with input from domain experts or legal scholars, as they help contextualise the decision-making process. For instance, in a predictive policing model, the explanatory attributes might include factors like neighbourhood crime rates or historical trends, rather than simply relying on race or socioeconomic status.

In my experience, finding the right explanatory attributes can be difficult, especially when working with complex datasets that have numerous potential variables. A wrong or arbitrary choice of explanatory attributes can lead to misleading conclusions about fairness or, worse, perpetuate existing biases in the data.

2. Data Availability and Quality

Another significant challenge is the availability and quality of data. In many cases, the data needed to condition on specific explanatory attributes may not be available or may not be well-represented across all groups. For example, if an organisation wants to account for historical inequalities when evaluating job candidates, the data on past decisions may itself be biased.

During one project, I worked with a client in the healthcare sector who wanted to implement fairness criteria for patient treatment predictions. However, the available data often lacked key contextual information, such as socio-economic factors or prior health conditions, which made it difficult to apply CDP effectively. This gap in data can make it challenging to assess or mitigate bias fairly.

3. Balancing Fairness with Accuracy

One of the most contentious issues when applying fairness metrics like CDP is the potential trade-off between fairness and predictive accuracy. Ensuring that the model meets fairness criteria often requires altering its decision-making process, which can result in a reduction in overall accuracy.

Take, for example, a model predicting loan approvals. In order to satisfy CDP, the model may need to adjust its decision boundaries so that individuals from unprivileged groups have an equal likelihood of receiving favourable outcomes, regardless of other factors. While this might improve fairness, it could also lead to an increase in false positives or false negatives, affecting the model’s accuracy and reliability.

During a previous project in the financial industry, we had to carefully balance fairness and accuracy when designing a model for credit scoring. The inclusion of certain explanatory attributes in the model, while improving fairness, led to a slight dip in accuracy. This necessitated difficult conversations with key stakeholders about the value of fairness in decision-making.

 

Practical Takeaways for Leaders and Stakeholders

As leaders and key stakeholders, it’s crucial to understand the implications of fairness in machine learning and how to address it effectively. Here are some practical takeaways based on my experiences:

  1. Understand the Context: Don’t just rely on demographic features like gender or race when assessing fairness. Consider the broader context by including explanatory attributes that can better explain disparities in outcomes.
  2. Engage Domain Experts: Work closely with legal, ethical, and domain experts to ensure that you’re selecting the right explanatory attributes and interpreting fairness metrics correctly. This collaboration will help ensure that the fairness considerations are both meaningful and practical.
  3. Prepare for Trade-offs: Be prepared for the possibility of a trade-off between fairness and predictive accuracy. It’s essential to have open discussions with stakeholders about the potential costs and benefits of prioritising fairness over other performance metrics.
  4. Data Quality Matters: Ensure that your data is representative and inclusive. Incomplete or biased data will undermine your efforts to achieve fairness, so invest in improving data collection processes and auditing data for bias.

 

Summary

As AI continues to shape our world, it’s clear that fairness is not an optional afterthought—it is a central component of responsible AI. By adopting fairness metrics like Conditional Demographic Parity, organisations can take meaningful steps towards ensuring that their models make decisions that are not only accurate but also just.

If you’re facing challenges in understanding or implementing fairness in AI within your organisation, I invite you to explore more detailed guidance, design cards, or training sessions tailored to your needs. Whether you’re looking to implement fairness metrics like CDP or navigate the complexities of responsible AI adoption, I’m here to help you build systems that drive both innovation and equity.

For more insights or to discuss how we can work together to make your AI practices more fair and impactful, feel free to reach out. Together, we can create a future where AI serves everyone equitably.

 

Next Steps

  • If you’re interested in bespoke training or design solutions on AI fairness, feel free to reach out for a consultation.

  • Check out our the following resources and upcoming workshops to equip your teams with the tools and knowledge to implement fair AI systems.

 

Free Resources for Individual Fairness Design Considerations

Data Bias

Sampling Bias in Machine Learning

Social Bias in Machine Learning

Representation Bias in Machine Learning

 

Conditional Demographic Parity Guidance – £99

Empower your team to drive Responsible AI by fostering alignment with compliance needs and best practices.

dribbble, logo, media, social Practical, easy-to-use guidance from problem definition to model monitoring
dribbble, logo, media, social Checklists for every phase in the AI/ ML pipeline

 
 
AI Fairness Mitigation Package – £999

The ultimate resource for organisations ready to tackle bias at scale starting from problem definition through to model monitoring to drive responsible AI practices.

dribbble, logo, media, social Mitigate and resolve 15 Types of Fairness specific to your project with detailed guidance from problem definition to model monitoring.
dribbble, logo, media, social Packed with practical methods, research-based strategies, and critical questions to guide your team.
dribbble, logo, media, social Comprehensive checklists for every phase in the AI/ ML pipeline
Get Fairness Mitigation Package– (Delivery within 2-3 days)
 
Customised AI Fairness Mitigation Package – £2499
We’ll customise the design cards and checklists to meet your specific use case and compliance requirements—ensuring the toolkit aligns perfectly with your goals and industry standards.
dribbble, logo, media, social Mitigate and resolve 15 Types of Fairness specific to your project with detailed guidance from problem definition to model monitoring.
dribbble, logo, media, social Packed with practical methods, research-based strategies, and critical questions specific to your use case.
dribbble, logo, media, social Customised checklists for every phase in the AI/ ML pipeline

 

Sources

Koumeri, L.K., Legast, M., Yousefi, Y., Vanhoof, K., Legay, A. and Schommer, C., 2023. Compatibility of Fairness Metrics with EU Non-Discrimination Laws: Demographic Parity & Conditional Demographic Disparity. arXiv preprint arXiv:2306.08394.

Vromman, F.V., Courtain, S. and Leleux, P., Maximum Entropy Logistic Regression for Demographic Parity in Supervised. In Artificial Intelligence and Machine Learning: 35th Benelux Conference, BNAIC/Benelearn 2023, Delft, The Netherlands, November 8–10, 2023, Revised Selected Papers (p. 189). Springer Nature.

Share:

Related Courses & Al Consulting

Designing Safe, Secure and Trustworthy Al

Workshop for meeting EU AI ACT Compliance for Al

Contact us to discuss your requirements

Related Guidelines

Fairness in machine learning has been predominantly studied through global metrics like Demographic Parity and Equalized Odds. These approaches aim

Fairness in cross-validation isn’t just a technical detail—it’s a critical component of responsible AI development, ensuring that your models serve

The growing need for fairness in machine learning models stems from the increasing reliance on AI for decisions that impact

Fairness in healthcare machine learning is highly context-dependent. Different use cases, populations, and risks require tailored approaches to fairness, making

No data was found

To download the guide, fill it out.