Skip to main content
AP CSP course

F27 · Topic 5.3

Recommendation bias investigation

Compare group error rates and overall accuracy in a fictional classifier. Evaluate a proposed mitigation without treating a group difference as proof of its cause.

1. Predict first

Group A has 20 cases and 8 errors; group B has 80 cases and 4 errors. Predict both accuracies and the overall accuracy.

Change it · step through · explain

Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.

Ready · Make a prediction

Ready to experiment
  1. Input 120,80Waiting
  2. Input 28,4Waiting

Ready to experiment

Why: Predict the first change, then advance one step.

Try this: Change group sizes while keeping very different error rates. Does a high overall accuracy hide a gap?

2. Build your procedure

Compare the baseline with a proposed error count 4 for A and 8 for B, holding group sizes fixed. Explain what improves, what worsens and what cannot be concluded from rates alone.

Use AP CSP pseudocode, a language you know, or precise plain language. Your code is not executed here. Use the classroom assignment to save your response.

3. Check boundaries

Public worked tests for the fixed model
InputExpectedWhy this case
Sizes 20,80; errors 8,4Accuracies 60%,95%; overall 88%Use each group’s denominator.
Sizes 20,80; errors 4,880%,90%; overall 88%Same aggregate, different distribution.
An error count above its group sizeReject inconsistent inputAn error rate cannot exceed the stated number of cases.

4. Explain and reflect

Name two development choices to investigate and one privacy constraint when evaluating unequal results.

Model limits: Aggregate synthetic counts only. The tool neither infers real protected traits nor declares a classifier legally or ethically fair.

Teacher guidance and scoring