Understanding AI · lesson 7 of 60 · about 5 minutes
Good Data, Bad Data
AI is only as good as the data it learns from. Learn to spot missing, wrong and lopsided data.
What you'll learn
- Spot missing values in data
- Spot wrong labels
- Explain why lopsided data makes lopsided AI
Garbage in, garbage out
If AI learns from bad data, it learns bad patterns. Three common problems:
- Missing: some details were never recorded.
- Wrong: a label is a mistake, like a cat photo labelled dog.
- Lopsided: far more of one kind of example than another.
Why lopsided data is sneaky
Imagine 990 photos of dogs and only 10 of cats. An AI that always says dog is right 99% of the time, without learning anything about cats.
It looks brilliant on paper and is useless for cats.
Counting each label shows how lopsided the data is. `count()` counts how many times something appears in a list.
labels = ["dog", "dog", "dog", "dog", "cat"]
print(labels.count("dog"))
print(labels.count("cat"))Output
4
1Tip
Before trusting any AI, ask: what did it learn from, and was that data complete, correct and balanced?
Now try it yourself
This lesson is free in Codiqo, with 6 questions on what you just read. You can only learn to code by writing code, so it ends with a short program you write yourself, which we run and check straight away.