# Fairness: Demographic parity

One method we can use to evaluate our model's predictions for fairness is to compare the admissions rate for the majority group and the minority group. If the two admissions rates are equal, then the model's predictions exhibit demographic parity: a student's chance of being admitted to the university doesn't vary by demographic group.

Suppose the admissions model accepts 16 candidates from the majority group and 4 candidates from the minority group. The model's decisions satisfy demographic parity, as the acceptance rate for both majority and minority candidates is 20%.

The following table quantifies the numbers supporting the rejected and accepted candidates in Figure 2.

Majority group Minority group
Accepted 16 4
Rejected 64 16
Acceptance Rate 20% 20%

The university admissions committee is considering using demographic parity as the fairness evaluation metric for their model, and needs your guidance on the benefits and drawbacks of this approach. Can you identify one pro and one con of evaluating the model's predictions using demographic parity?

Can you identify any problems with the feature data?

## Benefits and Drawbacks

The key benefit of demographic parity for our admissions example is that it ensures that both majority and minority groups are represented in the admitted class of students in the same proportions as they are in the candidate pool. That is, if the applicant pool is comprised of 80% majority-group candidates and 20% minority-group candidates, demographic parity guarantees that the group of admittees will also be 80% majority-group students and 20% minority-group students.

However, demographic parity has one significant drawback: it does not take the distribution of predictions for each demographic group (the number of students classified as "qualified" vs. "unqualified") into account when evaluating how the 20 admissions slots should be allocated.

Let's take another look at the composition of our candidate pool from above. However, this time we'll classify candidates not only by demographic group, but also by whether the model has scored each candidate as "qualified" or "unqualified":

The following table quantifies the numbers supporting the rejected and accepted candidates in Figure 3.

Majority group Minority group
Accepted Rejected Accepted Rejected
Qualified 16 19 4 11
Unqualified 0 45 0 5

Let's tabulate the acceptance rates for qualified students for both groups:

$$\text{Majority acceptance rate} = \frac{\text{qualified majority students accepted}}{\text{total qualified majority students}} = \frac{16}{35} = \text{46%}$$
$$\text{Minority acceptance rate} = \frac{\text{qualified minority students accepted}}{\text{total qualified minority students}} = \frac{4}{15} = \text{27%}$$

Even though both groups have an overall acceptance rate of 20%, satisfying demographic parity, the acceptance rate for qualified majority students is 46%, whereas the acceptance rate for qualified minority students is only 27%.

In cases like this, where the distribution of a preferred label (such as "qualified") varies greatly for both groups, demographic parity may not be the optimal metric to choose for evaluating fairness. In the next section, we'll look at an alternative fairness metric, equality of opportunity, which takes these differences into consideration.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]
{"lastModified": "Last updated 2024-08-13 UTC."}