Skip to content
BIASED

Fairness, privacy and accountability in production

Block 1 of 9~3 min

Define groups, decisions and error denominators

A model can satisfy its accuracy and latency targets while distributing mistakes unevenly, exposing information about training records or leaving a harmful decision without an accountable owner. System design specifies what a service should do. Responsible operation also specifies whose interests a decision affects, what evidence supports it and how someone can challenge it.

We use a fictional document-preview service to keep the calculations concrete. A positive decision requests human correction; a false positive creates unnecessary review, while a false negative leaves a defective preview uncorrected. All counts below are newly constructed. Groups A and B are artificial cohorts, not demographic observations or evidence about real people.

Baseline: leave the protected attribute out

Removing a group column does not make a decision independent of the group. Construct eight cases: in group A, three of four have a flag set; in group B, one of four does. A rule that requests review whenever the flag is set uses no group input, yet its selection rates are 75% and 25%. Correlated inputs can carry the distinction.

That calculation does not establish unfairness: it contains no outcome labels, costs or account of why the flag differs. It establishes the narrower failure of an argument: “the model does not read the group, therefore its decisions cannot differ by group.” To assess a deployment, define the affected population, the relevant outcomes and the harm of each error. Otherwise a dashboard can equalize a convenient number while ignoring the actual concern.

Measurement also needs appropriate access to group information. Do not infer sensitive categories from names merely to fill an audit table. Determine the permitted collection and use, who can access the data and how long it is retained. Missing information should be recorded as a limit of the assessment.

Three fairness criteria

Let Y=1Y=1 mean that correction is needed, and Y^=1\widehat Y=1 that the service requests it. Use the confusion-count definitions from Classification metrics. Three distinct questions concern the decision rate, the error rates conditional on truth, and the reliability of a positive decision:

  • Demographic parity asks for equal selection rates across the specified groups.
  • Equalized odds asks for equal true-positive and false-positive rates. Equal opportunity retains only the true-positive condition (Hardt, Price and Srebro).
  • Predictive parity asks for equal positive predictive value: among selected cases, what fraction truly need correction?

These are properties of a specified distribution and decision rule. They do not by themselves determine whether the labels, groups or intended action are appropriate. Predictive parity for a binary decision is also different from score calibration. A score SS calibrated within each group satisfies

P(Y=1∣S=s,G=g)=sP(Y=1\mid S=s,G=g)=s

at supported score values in each group. A thresholded decision combines multiple scores; its positive predictive value can differ between groups even when the scores are calibrated.

Here are two independently specified batches, each containing one hundred cases:

Group True positive False negative False positive True negative
A 30 10 15 45
B 15 5 20 60

Both groups have true-positive rate 0.75 and false-positive rate 0.25. Their other rates differ:

Group Positive truth rate Selected Positive predictive value
A 0.40 0.45 2/3
B 0.20 0.35 3/7

Every entry follows from the displayed counts. For instance, A selects 45 cases and 30 need correction. The table satisfies empirical equalized odds, but neither demographic nor predictive parity. It is an exact finite construction, not an estimate precise enough to certify a real population.

Answers are saved on the server and tied to this browser until you sign in.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • Error-rate denominators and privacy arithmeticoptional

    Groups are artificial, not demographic data. The fixed Laplace quantile is deterministic and is not a private release. Clipping includes no noise or accountant and is not DP-SGD training. No attack code, sensitive data or legal classification is executed.

    ~20 min · easier on a computer · The corresponding lesson and basic Python functions.

    Self-check in the notebook — not part of mastery or the certificate.