Raven pins Sky Sorter version 1 on the wall next to Rocket's patched version.
"Both are hand-written," she says. "Each threshold is a number one of us chose."
Rocket points at his 215. "I picked that because card E was 210. I was only fixing one card."
Nova shines a light on the pseudocode. "Hand-written rules have a strength too," she says.
"Anyone can read them and see exactly why a card got its label."
Raven nods. "So what is the weakness?" Rocket sighs. "Someone has to know the right rule first."
Hand-written rules are clear. You can trace them line by line, like we did with pseudocode.
They work well when a job has a simple, known rule, like converting minutes to seconds.
But someone has to know the right rule and the right threshold.
If the person guesses a threshold from only a few cards, the rule may fail on new ones.
ROCKET'S PATCHED RULES IF streak is yes THEN label = "satellite streak" ELSE IF size >= 8 THEN label = "comet" ELSE IF brightness >= 215 THEN label = "planet" ELSE label = "star"
| Job | Is there a simple known rule? | Better fit |
|---|---|---|
| Turn minutes into seconds | Yes: multiply by 60 | Hand-written rule |
| Decide if a year number is even | Yes: divide by 2 | Hand-written rule |
| Sort thousands of blurry snapshots | No: there are too many tricky cases | Learning from data |
| Statement | True or false? |
|---|---|
| Hand-written rules are easy to trace and explain. | ? |
| Turning minutes into seconds needs machine learning. | ? |
| A threshold picked from one card can fail on new cards. | ? |
| The computer changes hand-written rules by itself. | ? |
Sharp thinking! Tomorrow in the Explorer Lab, you let the data choose the cut-off.