Classification tree (source code)

= Classification tree

A classification tree partitions predictor space recursively and attaches a class probability vector to each terminal region. For a categorical response, a fitted leaf commonly uses its observed class proportions and predicts their largest entry. Binary numerical splits compare one coordinate with a threshold. Growing a tree greedily by reducing <classification-tree deviance> gives an interpretable rule but does not globally optimize the tree. <Cost-complexity tree pruning> and <cross-validation> control complexity and assess <prediction error>.