← Back to course
AI Explorers 6-8 / Week 04 / Wednesday
3/6
Week 04 · Representation and Reasoning

Wednesday

Explorer Lab: Build a decision tree
// From feature tables to decision trees
⏱ about 20 min

Wednesday: Explorer Lab: Build a Decision Tree

Rocket spreads the six practice cards across the floor. "Rules one at a time are slow," he says. "Let us chain them."

Raven draws a box at the top of a big sheet of paper and writes: "Streak?"

"Yes goes left, no goes right," she says. "Each answer leads to the next question."

Nova hovers above the sheet. "That is a decision tree," she says. "Which question should come first?"

Rocket taps the streak box. "The one that sorts out a whole group at once!"

They start drawing branches.

Your mission

You will build Sky Sorter's first decision tree on paper.

Then you will run all six practice cards through it and record the labels.

The tree uses three tests, one for each feature.

  • Six index cards, copied from Monday's table (cards A to F)
  • A large sheet of paper and a pencil
  • A ruler for drawing straight branches
  • Six counters or coins to move along the branches
Safety first
Use only paper, pencils, cards and counters.
Keep small counters away from younger brothers and sisters.
Question 1: Is there a streak?
Yes
Label: satellite streak.
No
Question 2: Is size 8 or more? Yes: comet. No: Question 3: Is brightness 200 or more? Yes: planet. No: star.
  1. Copy the tree onto your big sheet. Draw a box for each question and each label.
  2. Place a counter on the top question for card A.
  3. Answer the question using card A's numbers. Slide the counter down the matching branch.
  4. Keep going until the counter reaches a label. Write that label on card A.
  5. Repeat for cards B to F.
  6. Fill in the results table below.
CardBrightnessSizeStreak?Tree label
A1202no
B2305no
C9012no
D1801yes
E2103no
F1509no
PREDICT FIRST
  • Read the question.
  • Tap your answer.
Before you run the cards, predict: how many of the six will the tree label as comets?
Card E
↓
Streak? No
↓
Size 8 or more? No
↓
Brightness 200 or more? Yes
↓
Label: planet
Tree label for card A
Tree label for card B
Tree label for card D
Tree label for card F
How many questions did card A pass through before reaching a label?
WHY THIS EXERCISECards that are not streaks or comets travel the longest path.

Raven says card E is really a bright star, not a planet.

The tree still followed its rules exactly. The problem is in the rules, not in the following.

Lab resultTrue or false?
The tree labeled card C a comet.?
Card D never reached the size question.?
The tree labeled two cards as stars.?
Every card ended at exactly one label.?
WHY THIS EXERCISEA good decision tree sends every card to exactly one label.

Brilliant building! Tomorrow we turn the tree into pseudocode.

← Tuesday