Summary
A decision tree predicts a constant value within each terminal feature region. Training chooses threshold splits greedily, using a stated criterion and stopping rules.
Task: the diagram has four circles, class zero, and four triangles, class one. Candidate root puts three circles and one triangle left; one circle and three triangles go right. Calculate its Gini reduction and predict a new point after the right-only child split .
The drawn split is a candidate, not a proven best threshold among unenumerated alternatives.
The algorithm (CART, Breiman et al., 1984)
- Enumerate allowed feature thresholds, usually midpoints between distinct ordered numeric values.
- Route left and right; reject candidates violating leaf constraints.
- Choose maximum sample-weighted impurity reduction, then recurse under the stopping rules.
This local choice need not produce the globally best tree.
Learning objective: map each root-to-leaf rule path to one axis-aligned region of feature space and its constant leaf prediction.
Rules become regions
The second split affects only the root's right-hand region
Derivation
Does changing y above one move any x<=0 point out of A?
Split criteria
For class proportions , Gini impurity is . Use
| State | Calculation | Gini |
|---|---|---|
| Parent | ||
| Each root child | ||
| Weighted root children |
Root improvement is . The right child separates three triangles from one circle, leaving total weighted impurity . Point reaches that pure-triangle R1 leaf, with empirical triangle fraction .
Sample weights matter: a separate pure child of size three and impurity- child of size five give weighted impurity . An unweighted mean gives , incorrectly treating unequal child sizes equally.
Entropy gives entropy information gain, not the same numerical quantity as Gini reduction. For regression, a leaf mean minimizes its summed squared error.
Stopping and pruning
New task: require at least four samples per leaf. The 4/4 root remains legal; its proposed 3/1 right split does not. Check: now receives the unsplit right leaf’s triangle fraction , not . Use when: tiny leaves provide insufficient support or excessive variance.
New task: predict numeric targets with , , and threshold . Replace class fractions and Gini with means and squared residuals. Check: the unsplit mean has SSE ; leaf means and give SSE zero. Use when: the output is a continuous response.
Depth, minimum leaf size, purity, and improvement limits stop growth. Cost-complexity pruning compares subtrees using ; select using validation, not test outcomes.
Failure: either first axis split on four XOR corners has zero gain, although a depth-two tree separates them. Stopping on nonpositive immediate gain can miss that interaction.
Reconstruct: at exactly, does the right child inspect ?
Answer
No. The rule routes left; a child test applies only to the region reaching it.
Strengths and weaknesses
Paths provide explicit rules and can represent interactions through successive splits. Strictly increasing numeric transformations preserve candidate partitions when ordering and implementation arithmetic are preserved. Rotated boundaries may require many axis-aligned regions; feature engineering or oblique tests changes that representation. Small data changes can change selected splits. Neither a single tree nor an ensemble has a universal production ranking.
Categorical features
One-hot encoding and native categorical splitting define different candidate partitions and costs. Arbitrary integer codes impose an ordering that may not match category meaning. Target-based category statistics require leakage controls. Library algorithms, including CatBoost’s ordered statistics, are not interchangeable with simply sorting all categories by target mean.
Common pitfalls
Missing-value routing needs an explicit supported strategy: imputation, learned default directions, or surrogate splits, depending on implementation. Do not assume every tree accepts missing or categorical values. Empirical leaf fractions are not guaranteed calibrated probabilities for new populations. Feature importance can reflect split-selection biases; evaluate stability and held-out perturbations before interpreting it.
Related
- Random forests. Bagged ensembles of trees.
- Gradient boosting. Boosted ensembles of trees.