Decision Tree Learning
Decision trees are probably the most human of all learned models. A doctor's triage flowchart, a bank's loan checklist and a 20-questions game are all decision trees. This chapter shows how to learn one automatically from examples, using an idea from information theory: ask the question that tells you the most.
Decision trees also tie together everything so far:
- Building a tree is a greedy search through the space of trees: hill climbing (Ch 3) with no backtracking.
- The search is guided by entropy, a measure of uncertainty built from probability (Ch 4).
- Choosing the most informative attribute mirrors the value of information (Ch 5).
- Trees overfit spectacularly if left unchecked, and we fix that with the validation and pruning ideas of Ch 2.
- §6.1 What is a decision tree?: representation, expressiveness, and why we can't just try them all.
- §6.2 Entropy and information gain: measuring uncertainty in bits, and how much a question reduces it.
- §6.3 Building a tree: ID3: the full algorithm, worked by hand on the classic PlayTennis data, plus code and an interactive builder.
- §6.4 Overfitting, pruning and real-world trees: depth vs. accuracy, pruning, continuous attributes, missing values and random forests.
The canteen manager asks: "Can you tell me in advance which orders will be late, and why?" A neural network might predict well, but it can't explain itself. A decision tree can: "If the distance is over 3.2 km, it'll be late. Otherwise, if it's between 9 and 11 pm (rush hour) and over 1.5 km, it'll be late. Otherwise it's on time." That's a model the manager can read, check and act on.