Categorical › Classification (supervised)

Decision tree (CART)

A CART decision tree splits the data recursively on one predictor at a time, detecting automatically whether the outcome calls for regression or classification.

What is Decision tree (CART)?

CART builds a binary tree by recursively choosing the best split (variable + threshold) at each node — best meaning the split that most reduces impurity (Gini / entropy for classification, residual SS for regression). Splits stop at leaves when no further improvement justifies the added complexity.

Trade-off vs other models: trees are interpretable (each prediction is a chain of if-then rules), handle non-linear interactions natively, and tolerate mixed numeric / categorical inputs without preprocessing. But single trees overfit easily and are unstable (small data changes give different trees) — for production prediction, an ensemble (random forest, boosted trees) usually wins.

The cp (complexity parameter) controls pruning: smaller cp ⇒ larger tree. Use the 1-SE rule on the printed cptable to pick a parsimonious cp.

When should I use Decision tree (CART)?

  • Interpretable rule extraction (clinical decision rules).
  • Initial exploratory model with mixed predictor types.
  • When you need to communicate the model to a non-statistical audience.

What data does it need?

Outcome (numeric → regression, categorical → classification) + predictors + cp + minsplit + maxdepth.

What does it report?

Indented tree + variable importance bars + confusion matrix or RMSE/R² + a cost-complexity table for pruning.

How do I interpret the result?

Variable importance rankings are influenced by the splitting algorithm — use as a relative ranking, not as absolute effect sizes.

See also

References

  • Breiman, Friedman, Stone & Olshen (1984). Classification and Regression Trees.