A chain of yes/no questions that sorts a pile
Show on a big screenA lost-property box holds things people forgot to take. It has a sock, a tiffin box and a rope. Sort them onto shelves.
- One question to start: does it have pages?
- Yes: paper shelf. No: ask about cloth.
- Yes: cloth shelf. No: ask about food or drink.
- Yes: food-and-drink shelf. No: the odds box.
A decision tree asks one yes/no question at a time. Two things that end up together gave the same answers. Each answer leads to the next question. The odds box holds what fits no shelf.
You chose these questions. A program can also choose questions, from labelled examples. A labelled example is one case with its answer already on it. The tree looks the same.
A question that leaves everything on one side has not helped. Each thing gets the same answer, so nothing is sorted. Good questions split the pile.
Ask the questions. Count what is left.
Loading lab…
Try the lab to finish this lesson.