Understanding AI · lesson 24 of 60 · about 5 minutes
Choosing What to Measure
The number you train for is the thing you get. Learn to pick the measure that matches what really matters.
What you'll learn
- Explain why the chosen measure shapes the model
- Pick a measure that matches the real goal
- Spot a goal that will backfire
You get what you measure
Training pushes a number down (or up). Whatever that number is, the model gets very good at it, even if it isn't what you actually wanted.
A video app that measures only watch time may learn to recommend outrageous videos that keep people glued, not videos that leave them happier.
Pick carefully
For an illness test, you might care most about catching every case, accepting a few false alarms. For a spam filter, you might care most about never hiding a real email. The right measure depends on which mistake hurts more.
Two models with the same accuracy but different mistakes. Which is better depends on what matters.
models = {
"A": {"false_alarms": 8, "misses": 0},
"B": {"false_alarms": 0, "misses": 8},
}
for name, mistakes in models.items():
print(name, "misses:", mistakes["misses"])Output
A misses: 0
B misses: 8Tip
Before training, decide which mistake would hurt most.
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.