Fairness in Machine Learning: A Beginner's Guide

Fairness in Machine Learning: A Beginner's Guide

Fairness in machine learning is about making sure that an AI system does not treat people or groups unjustly. That sounds simple, but it turns out to be one of the trickiest problems in AI, because there are several reasonable definitions of "fair", and they can conflict. This beginner's guide explains the main ideas behind fairness in machine learning, the common ways it is measured, and practical steps teams and small businesses can take. It complements our guide to bias in AI, which focuses on how unfair outcomes arise.

Why fairness is a design choice

A machine learning model makes predictions: will this applicant repay a loan, is this transaction fraud, which candidate fits this role. Every model makes errors. Fairness asks how those errors and benefits are distributed across people. Is one group more likely to be wrongly rejected? Does one group get fewer opportunities? Because there is no single right answer, fairness is a choice that people have to make deliberately, based on the context and the values involved.

Three common definitions of fairness

Demographic parity

Each group receives positive outcomes at the same rate. For example, if 30% of applicants overall are approved, roughly 30% of each group should be approved. This is easy to understand but can ignore genuine differences in the underlying situation.

Equal opportunity

Among people who actually qualify, each group has the same chance of being correctly approved. This focuses on not missing deserving people in any group.

Equalised odds

Both the rate of correct approvals and the rate of wrong approvals are similar across groups. This is stricter, balancing both kinds of error.

Research has shown that, except in special cases, a model cannot satisfy all of these at once. Choosing one is a judgement about what kind of fairness matters most in that situation. Google's machine learning crash course on fairness works through examples of these trade-offs.

Individual vs group fairness

Group fairness compares outcomes between groups. Individual fairness says that similar people should be treated similarly. Both matter. A system can look balanced between groups while still treating two near-identical individuals differently, or the other way round.

How fairness is checked in practice

  1. Define the decision and its stakes. What does the model decide, and what happens to people if it gets it wrong?
  2. Identify relevant groups. Consider protected characteristics such as sex, age, disability, religion and ethnicity, as well as local factors like region or language.
  3. Break down performance. Look at accuracy, false positives and false negatives for each group, not only the overall score.
  4. Pick a fairness goal. Decide which definition fits the context and set an acceptable gap.
  5. Adjust and retest. Options include collecting better data, changing features, re-weighting examples, or adjusting decision thresholds.
  6. Monitor after launch. Fairness can drift when the population or conditions change.

Fairness and the law

Fairness is not only an ethical idea. Anti-discrimination law applies to decisions whether a person or an algorithm makes them. In the EU, the AI Act treats AI used in areas such as employment, education and access to essential services as high-risk, with requirements on data quality, documentation and human oversight; those high-risk rules are scheduled to apply from December 2027. Data protection laws, including Nigeria's NDPA 2023, also give people rights around automated decision-making.

Fairness for generative AI

Fairness is not only about scoring and ranking. Generative tools can produce unfair content too: stereotyped images, one-sided descriptions or uneven quality across languages and accents. For people using these tools:

  • When generating images with the AI Image Generator, describe the diversity you want rather than relying on defaults.
  • When drafting with the AI Writer or AI Chat, review the text for assumptions about gender, age, nationality or ability.
  • Test speech tools with the accents of your real users before relying on them.

A simple fairness checklist for small teams

  • Do we know who could be harmed if this tool is wrong?
  • Have we tested it with examples from different groups?
  • Can a person review and override the result?
  • Can affected people ask questions or appeal?
  • Have we written down the decisions we made and why?

For examples of what goes wrong when fairness is ignored, read bias in AI: real examples. For the question of who answers for those failures, see who is responsible when AI makes a mistake.

Fairness in Nigerian and African contexts

Many AI systems are built and tested mainly on data from North America, Europe and East Asia. When used in Nigeria, they may be less accurate for local names, languages such as Hausa, Yoruba and Igbo, accents, skin tones or cultural contexts. Fairness checks should therefore include the groups you actually serve. A credit model, for example, might behave differently for customers in rural areas or those paid in cash. Testing with local data and involving local users is the only reliable way to find these gaps.

Key takeaways

  • Fairness has several definitions that can conflict.
  • Choose a fairness goal that fits the decision and context.
  • Test performance for each group you serve.
  • Monitor fairness after launch, not just before.

Related guides

Keep reading in this topic cluster:

Frequently asked questions

What is the difference between bias and fairness in AI?

Bias describes systematic skew in data or results. Fairness is the goal of treating people justly, along with the methods used to measure and achieve it.

Can a model be fair and accurate at the same time?

Often, yes, especially when unfairness comes from poor data. Sometimes there are trade-offs, and teams must decide how to balance them.

Which fairness metric should I use?

It depends on the decision. For opportunities like jobs or loans, equal opportunity is common. For high-stakes errors, equalised odds may fit better. Document your reasoning.

Do small businesses need to worry about AI fairness?

Yes, if AI influences decisions about customers or staff. Even simple screening tools should be tested and reviewed by a person.