WeCodeAcademy

Bias in Data and Models

A model learns whatever patterns are in its training data, including unfair ones. If most examples come from one group, the model will work well for that group and badly for others, even if nobody intended it. This is bias.

The first defence is to look at performance by group, not only overall. A high overall accuracy can hide a group that is badly served.

Examplepython
Open in editor »
Quick check

Why report accuracy by group as well as overall?

Your turn: write the code

Print the accuracy for group B only, rounded to 2 decimals.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.