Animal Decision Tree¶
Goal¶
Students construct decision trees to identify animals.
Time¶
60’
The Game: Twenty Questions¶
One player thinks of an animal. The others try to guess it by asking questions. The first player only answers “yes” or “no”:
Q: can it fly?
A: no
Q: does it have 4 legs?
A: no
Q: is it a snake?
A: yes
Q: is it a Python?
A: yes!
Decision Trees are machine learning models that identify questions to make efficient predictions. They are the computerized version of the twenty questions game.
To implent the tree model with a larger group, you should have a set of 8 different animals. I used the material from the game Tier auf Tier. Any other animal figures should work as well. The first versions of the game worked with animals on paper cards.
Each group needs a bag with 8 different animals. They will pick 4 at random Sheets of paper for drawing trees should also come in handy.
Lesson Plan¶
Students should have a basic understanding of what machine learning and supervised learning are.
step |
description |
time |
|---|---|---|
Play a few rounds of “Twenty Questions” with the class. You pick the first animal, students pick the next. |
5’ |
|
Discuss components of a tree (see Figure in the linked chapter) |
5’ |
|
ask students to construct decision trees |
10’ |
|
put the trees on display in class |
5’ |
|
make predictions for all animals in the test set for all trees |
10’ |
|
calculate the accuracy of each individual tree |
10’ |
|
make a consensus prediction (majority vote) |
5’ |
|
calculate the accuracy of the consensus |
5’ |
Note
The choice of animals is crucial for how well the random forest works. The 8 animals simplify the model a bit, because not all target classes are used by all the trees. But it should get the idea across and allow you to follow up with theory.
Material¶
See also