Fixing Sorting Mistakes
Nobody is perfect the first time — not people, and not machines. When a sorting machine makes mistakes, that is not the end of the story. It is actually useful information! Mistakes tell us exactly where the machine needs more help. In this lesson we learn how to fix a sorting machine that is getting things wrong.
Find the Pattern in the Mistakes
When a machine makes sorting mistakes, smart engineers do not just shrug. They look at which examples the machine got wrong and ask: what do these have in common? Imagine a machine learning to sort photos of sunny days and rainy days. It keeps mistaking foggy days for sunny days. Why? Because the dataset had almost no foggy-day photos! The machine never learned what fog looks like. The fix: add more labeled foggy-day photos to the training set. Give the machine the examples it is missing.
Sorting mistakes are clues. They show us exactly which examples or groups the machine needs more practice with. Add better examples and try again.
Here are three common reasons a sorting machine makes mistakes, and how to fix each one: 1. Not enough examples. The machine has seen too few examples of one group. Fix: collect and label more examples of that group. 2. Messy labels. Some examples were labeled wrong in the dataset. Fix: review the labels and correct the mistakes before training again. 3. Tricky in-between examples. The groups overlap a lot. Fix: add more examples that show the differences clearly, or reconsider whether the groups make sense.
Flashcards — click each card to reveal the answer
After adding new examples or fixing labels, the engineers retrain the machine — they let it study the improved dataset all over again. Then they test it with the test set to see if the score went up. This process — train, test, check mistakes, improve, train again — can repeat many times. Each loop makes the machine a little bit better.
Real machine-learning teams often retrain a machine dozens of times before they are happy with its score. Expect the process to take several rounds — that is completely normal.
A machine keeps mistaking cats with orange fur for dogs. What is most likely missing from the training set?
What should you do FIRST when a sorting machine makes mistakes?
The Fix-It Round
- Play the sorting card game from Lesson 7 again, but this time you only got 1 out of 3 test cards right.
- Look at the 2 cards you got wrong. What do they have in common?
- Now draw 3 more example cards to add to your study collection — cards that would help you learn the tricky cases better.
- Study your expanded collection for one minute.
- Test yourself again with 3 new secret cards.
- Did your score improve? Talk about why the extra examples helped.