statable Statistics for study and research

Who belongs to which group? (decision tree, classification tree, regression tree)

In brief

A decision tree divides people step by step by yes/no questions (for example "age less than 12.5?") into ever more uniform groups. It predicts which group a person belongs to. If the target is a number with many values, it predicts the mean in each leaf (regression tree).

When

How it works in Statable

  1. Run the card "Can something be predicted?". Under the result open the section "Decision tree: who belongs to which group?".
  2. Choose the target under "Which group should be predicted?" (or "Which number should be predicted?"), and the columns under "From which columns?".
  3. Click "Grow the tree". Statable calculates in the browser.

Reading the result

What is often misunderstood

Trees are unstable: with other people the tree often looks quite different. It describes what fits these data and shows no causes.

Reporting the result

Report: target and columns, the method (CART, splitting by the Gini measure) with the settings (minimum number of cases to split and per leaf, complexity parameter cp), the fixed split into training data (70%) and test data (30%), the number of leaves, the hit rate on the test data next to guessing the most frequent group (for numbers the mean error next to guessing the mean) and the most important columns. Also: the tree itself as a figure or list and the note that the importance holds only for this one tree. Method: Breiman, Friedman, Olshen & Stone 1984, Classification and regression trees.

The decision tree (CART, Gini measure; at least … cases per split, at least … per leaf, cp = …) was grown on 70% of the cases (n = …) and tested on the other 30% (n = …). It has … leaves. On the test data the prediction was right in … % of the cases (guessing the most frequent group: … %). The most important columns were … .

For specialists

CART as R rpart (method = "class") with the defaults: split by the largest Gini improvement, at least 20 cases to split (minsplit), at least 7 per leaf (minbucket), pruning by cost-complexity with cp = 0.01. Numbers are split at the midpoint between two values, groups as a two-way split of all levels.

Sources

Breiman, L., Friedman, J. H., Olshen, R. A. & Stone, C. J. (1984). Classification and regression trees. Wadsworth. Therneau, T. M. & Atkinson, E. J. (2023). An introduction to recursive partitioning using the RPART routines. Mayo Foundation.

Related

Open in Statable