← Back to course
1/6
Week 05 Β· Rules or Learning?

Monday

Rocket's rule breaks
// Two ways to build a helper
⏱ about 15 min

Monday: Rocket's Rule Breaks

Rocket fixes the tree. He adds a rule: if it is shiny, then tool.

The metal ruler lands in tool. "Fixed!" he cheers. Then a shiny wet rock lands in tool too.

Raven holds it up. "What do you notice? Rocks can be shiny too!"

Nova circles the cards. "Rules are one way," she hints. "Is there another way to teach a helper?"

Two ways to build a helper

There are two big ways to make a computer helper.

Way 1: A programmer writes exact rules. The computer follows them.

Way 2: The computer learns from examples. It finds patterns in data.

Finding patterns in data is called machine learning.

Way 1: RulesWay 2: Learning from examples
Who does the main work?A programmer writes the rulesThe computer finds patterns
What does it need?Clear rules for every caseLots of examples with answers
Sorting photosIf it has a handle, then toolLook at many labeled tool photos
RULES OR EXAMPLES?
  • Read the question.
  • Tap your answer.
Rocket writes: if it has leaves, then plant. Which way is that?
A computer looks at 1,000 labeled rock photos and finds what they share. Which way?
What is finding patterns in data called?

Why did the rule break?

Rocket's new rule only looked at one feature: shiny.

The metal ruler is shiny. But a wet rock can be shiny too.

One simple rule could not tell them apart.

Writing rules for every tricky case is hard.

StatementTrue or false?
A programmer can write exact rules for a helper.?
A computer can learn patterns from examples.?
Rocket's shiny rule worked for every photo.?
Machine learning means finding patterns in data.?
WHY THIS EXERCISERules and learning are two different ways to build a helper.
What word means something that shows up again and again in many examples?
WHY THIS EXERCISEMachine learning is all about finding patterns.
Way 1: a programmer writes ____.
Way 2: the computer learns from ____.
Try it
Write one rule to tell a cat from a dog. Example: if it barks, then dog.
Now think of a cat or dog your rule would get wrong.

Great thinking! Tomorrow we write and test if-then rules like a programmer.