← Back to course
2/6
Week 06 Β· Training Data

Tuesday

Patterns in the data
// Learning from labeled examples
⏱ about 15 min

Tuesday: Patterns in the Data

Raven spreads 16 labeled photos across the floor. "Now we look for patterns," she says.

Rocket points. "Every plant photo has leaves!"

"What do you notice about the two tools with no handle?" Raven asks.

Nova hovers low. "Here is a hint," she says. "Count each feature for each label. Then compare."

Finding patterns

Machine learning finds patterns in data.

One way to find a pattern is to count.

Count how often each feature shows up for each label.

If a feature shows up for one label again and again, that is a pattern.

Here is the crew's training data: 16 labeled photos, described by their features.

LabelHow many photosTheir features
tool4shiny metal, a handle, straight edges
tool2shiny metal, no handle, straight edges
plant5green, leaves
rock3gray, lumpy
rock2shiny and wet, gray, lumpy
How many photos are labeled tool in all?
How many photos are shiny?
How many photos are there in all?

What the counts show

Featuretoolplantrock
a handle400
straight edges600
shiny602
leaves050
lumpy005
SPOT THE PATTERN
  • Read the question.
  • Tap your answer.
Every photo with straight edges has which label?
Every photo with white dots spread out has which label?
Is "shiny" enough to tell the label?

Rocket's old rule looked for shiny things. It mixed up tools and wet rocks.

The data shows a better clue. Straight edges only show up in tool photos.

The training data taught the crew a pattern they missed.

StatementTrue or false?
Straight edges show up only in tool photos here.?
Shiny photos are always tools.?
Counting features can reveal a pattern.?
Machine learning finds patterns in data.?
WHY THIS EXERCISEPatterns in the counts help the model tell tricky photos apart.
How many tool photos have no handle?
WHY THIS EXERCISEEven two examples showed a useful pattern, but more would help.
FIND A PATTERN BY COUNTING
  • ?Count it for each label.
  • ?Write the counts in a table.
  • ?Collect labeled examples.
  • ?Pick one feature to count.
  • ?Look for a feature that shows up for only one label.
WHY THIS EXERCISECounting features for each label is one way to find patterns in data.

Super pattern finding! Tomorrow you train your own paper model in the lab.

← Monday