Decision trees
A sequence of yes/no questions leading to a prediction.
A decision tree predicts by asking a sequence of yes/no questions about the features. Each internal node tests one feature against a threshold ('age < 30?'), each branch is an answer, and each leaf holds a prediction — the majority class (classification) or the mean target (regression).
Trees are built greedily, top-down: at each node, try every feature and threshold, pick the split that makes the children purest, and recurse. Stop when nodes are pure, too small, or a maximum depth is reached.
Strengths: easy to explain and visualise, handle numerical and categorical features, need no feature scaling, capture non-linear interactions. Weakness: a deep tree overfits easily, and small changes in data can produce a very different tree (high variance).
Formula to remember
Entropy
0 for a pure node, 1 bit for a 50/50 split.