Machine Learning

Decision Tree

A decision tree is a model that predicts an outcome by asking a sequence of yes-or-no questions about a record, following the answers down branches until it reaches a leaf that holds the prediction.

What is a decision tree?

A decision tree is a machine learning model shaped like a flowchart. Each internal node tests one input, such as whether an account is more than 60 days past due. Each answer leads down a branch to the next test, and each path ends in a leaf that holds the prediction. Classification trees predict a category, and the mix of training records in a leaf gives a rough probability. Regression trees predict a number, usually the average of the training records in the leaf.

Trees are among the few models a business user can read directly, which makes them a common answer to questions of interpretability. A trained tree can be printed, reviewed line by line, and translated into rules for an existing system.

How a decision tree works

Training builds the tree from the top down. At each node, the algorithm tries every input and every candidate split point. For classification it picks the split that leaves the outcomes on each side least mixed, measured by Gini impurity or entropy. For regression it picks the split that most reduces squared error. The process repeats on each branch until a stopping rule applies, such as a maximum depth or a minimum number of records per leaf. Without such limits, a tree keeps splitting until it memorizes the training data and overfits. Pruning then removes branches that do not improve accuracy on validation data.

Decision trees in practice

An outpatient clinic group loses capacity to missed appointments. A tree four levels deep, trained on a year of scheduling records, finds the strongest signals: the days between booking and the visit, the patient’s prior no-shows, and whether the reminder text was confirmed. Front desk staff can read all the rules on one page, and the scheduling system uses them to queue a personal reminder call for high-risk visits. A gradient-boosted model scored somewhat better in testing, but the clinic chose the tree because staff could see why each appointment was flagged.

What to watch for

  • Small changes in the training data can produce a very different tree, so compare the rules after each retraining before replacing a tree people rely on.
  • A single tree is usually less accurate than a random forest or gradient-boosted trees, so measure that gap before trading accuracy for readability.
  • Readable rules can still discriminate, because a split on postal code or appointment type may stand in for a protected characteristic.

← Back to AI Glossary