Student Performance Prediction · Project

Student Performance Prediction · Phase 4 · Lesson 2 of 3

Measuring Fairness Between Groups

Compare recall and precision between groups such as girls and boys or rural and town schools, interpret differences carefully, and decide what to do about them.

What you need

A computer with a web browser and a free Google account for Google Colab, or Python with Jupyter installed locally. Libraries: pandas, scikit-learn and matplotlib (all free).

In this lesson you will

  • Calculate performance by group
  • Interpret and respond to group differences

Key concepts

group fairnessrecall by groupdisparitysample sizemitigation

The lesson

A model can perform well overall and still miss more students in one group. If girls who need support are flagged less often than boys, girls may receive less help. Calculate recall and precision for each group defined in the evaluation plan.

Interpret with care: small groups give unstable figures, so report the counts as well as percentages. Look for causes in the data: is a feature measured differently for one group?

Possible responses include adding or improving features, adjusting thresholds by group with clear justification, collecting better data, or deciding the model is not fit for use. Record the decision and the reason.

Step by step

  1. Calculate recall and precision for each group with counts.
  2. Compare the gap with the threshold set in the evaluation plan.
  3. Investigate one possible cause.
  4. Write the decision and its justification.
Data and chart

Recall for girls and boys on the test set

The same model misses a larger share of girls who need support than boys.

Test set of 200 synthetic students (illustrative figures)
GroupNeeded supportCorrectly flaggedRecall (%)
Girls181266.7
Boys221881.8
All students403075
Recall by group (%) Recall (%): Girls 66.7, Boys 81.8, All students 75 022.54567.590GirlsBoysAll students

What the data shows

Overall recall is 75%, but the model flags 12 of 18 girls who need support (66.7%) against 18 of 22 boys (81.8%).

The groups are small, so the gap of about 15 percentage points is uncertain, but it exceeds the 10-point limit set in the evaluation plan and must be investigated before any use.

A possible cause to check: if girls miss school for different reasons (for example family duties), attendance may predict risk differently for them.

Practice activity

Produce a fairness section with group results, interpretation and a documented decision.

Expected result: Group results with counts, a careful interpretation and a clear, justified decision.

Common mistakes

  • Reporting only overall results
  • Treating a gap in a tiny group as certain

Check your understanding

  1. Why report counts as well as percentages for each group?

    Show answer

    Small groups give unstable percentages; counts show how reliable they are.

  2. Name one possible response to a fairness gap.

    Show answer

    Improve features or data, adjust thresholds with justification, or decide not to use the model.

Further learning

Projects are instructor-guided: an instructor sets milestones, checks your work and gives feedback, online or in person. Self-study of the public lessons does not lead to a certificate. Enrolment and fees follow the Academy's existing policies — contact the Academy.