A model made of questions
A decision tree predicts by asking a sequence of yes-or-no questions about the features, each answer sending the example down one branch until it reaches a leaf that holds the prediction.
Definition: Each internal node tests one feature against one threshold, such as debt-to-income above 0.4? A leaf predicts the majority class (classification) or the mean label (regression) of the training examples that ended up there.
Trees have properties the linear models from earlier in this course lack:
- Interactions for free. A split on income inside the branch for young applicants means income matters differently by age, with no engineered feature.
- No scaling needed. A threshold on square metres works the same as one on square feet.
- Mixed feature types. Numbers, categories and missing values can all be split on.
- Readable when small. A depth-3 tree fits on a slide and can be checked by a domain expert.
Their weakness is the flip side of that flexibility, and fixing it is what random forests and boosting are for.

