Ethical AI · Intermediate level

Intermediate level · Module 3 of 7 · 15 guided hours

Identifying Bias in Datasets and AI Predictions

Learners train a baseline classifier, then compare its predictions with actual outcomes by group to find where the model over- or under-predicts. They visualise gaps and test whether they are large enough to act on.

Learning objectives

  • Train a baseline classification model with scikit-learn
  • Compare predicted and actual outcomes by group
  • Visualise and interpret prediction gaps

Topics

  • baseline models with scikit-learn
  • train/test splits and stratification
  • predicted vs actual rates by group
  • confusion matrices by group
  • visualising gaps with Matplotlib
  • small-group uncertainty

Lessons

  1. Lesson 1 Training a Baseline Model

    A careful, reproducible scikit-learn baseline (logistic regression with a fixed random seed and stratified split) that later lessons analyse for bias.

    train/test splitstratifyrandom_stateLogisticRegressionaccuracy

  2. Lesson 2 Comparing Predicted and Actual Outcomes by Group

    Learners compute predicted and actual pass rates and error rates for each group and identify where the model systematically under-predicts success.

    predicted rateactual rateunder-predictionconfusion matrix by groupdisaggregated evaluation

  3. Lesson 3 Visualising Gaps and Judging Their Size

    Learners chart group gaps with Matplotlib and learn to judge whether a gap is large and stable enough to act on, given small groups and random variation.

    grouped bar chartsample sizeuncertaintybootstrapmateriality

Practical activity

Train the project baseline model, produce the by-group comparison of actual and predicted outcomes with confusion matrices and a gap chart, and write a one-page 'bias findings' note.

Expected outcomes

  • Ability to detect bias in model predictions
  • A documented baseline and bias findings

Assessment

Notebook review against a checklist (60%) and the bias-findings note (40%).

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.