Skip to content
atlas

Decision tree

Also known as: CART, classification tree, regression tree

A model that reaches an answer by asking a chain of yes or no questions about the input, each answer leading to the next question.

Draft - this entry has not been reviewed yet.

Formal

A model that splits the training data again and again on one feature at a time, picking each split that best separates the known answers, until each end point holds cases that mostly agree; a new case follows the splits to an end point and gets its answer.

In plain English

Like the game where you guess an animal by asking questions such as "Does it fly?" and "Is it bigger than a cat?", with each answer ruling out part of the list.

In practice

A Danish insurance company sends claims for manual review when a short tree of rules says so, for example claim over 50,000 kroner and policy less than three months old, and staff can print the rules.

Why it matters

A small tree can be read and checked by a person, which helps when a decision must be explained, and trees are the building block of the strongest methods for data in tables.

Technical deep dive

A decision tree partitions the feature space into axis-aligned regions by recursive binary splitting. At each node the learner searches every feature and threshold for the split that most reduces an impurity measure: Gini impurity or entropy (information gain) for classification, mean squared error for regression. Leaves predict the majority class, or class proportions, or the mean target of their training samples. Finding the optimal tree is NP-hard, so all practical algorithms are greedy and top-down.

The main algorithm families are ID3 (Quinlan, 1986), which used information gain on categorical features; its successor C4.5, which handles numeric features by thresholding and prunes with error estimates; and CART (Breiman, Friedman, Olshen and Stone, 1984), which builds strictly binary trees for both classification and regression and prunes by cost-complexity. scikit-learn implements an optimised CART.

Unconstrained trees keep splitting until leaves are pure and so memorise the training set, a textbook case of overfitting with high variance: small changes in the data can produce a completely different tree. Controls are pre-pruning (maximum depth, minimum samples per leaf or split, minimum impurity decrease) and post-pruning such as CART's minimal cost-complexity pruning, tuned by cross-validation. Trees need no feature scaling, handle mixed data types, and capture interactions naturally, but their axis-aligned, piecewise-constant predictions approximate smooth or diagonal boundaries poorly and cannot extrapolate beyond the training range.

A shallow tree is one of the few models whose full decision logic a person can read, which is why it is used as an interpretable model and as a surrogate to explain black-box models. Impurity-based feature importances from trees are cheap but biased toward features with many distinct values; permutation importance is the usual check. Their instability is also the reason ensembles work so well: random forests average many decorrelated trees to cut variance, and gradient boosting adds many shallow trees in sequence to cut bias.

What to learn first

Everything this builds on, foundations first.

  1. Training data
  2. →Feature
  3. →Decision tree

Relationships

Requires
Feature

Sources & further reading

Official documentation

Reference works

Textbooks

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

Where this data comes from

This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.

See the review queueSuggest a correction on GitHubThis term as JSON

Check yourself

Loading…

Atlas is in beta.