← AI glossary

AI glossary · Basic · Classic ML, recsys & search

Decision tree

A decision tree is a prediction model that splits data by asking a series of yes/no questions and gives an answer at the final branch. Combining many decision trees and deciding the answer by vote is called a random forest.

About this term
Level
Basic · Technical terms you often meet in AI news
Added
2026-10-08
In plain words It works like the game Twenty Questions. You keep asking questions that narrow things down, such as 'Is it alive?' and 'Can it fly?', until you reach the answer. A random forest is like several people each playing Twenty Questions and then picking the answer by majority vote.

How it works

During training, the model picks the question that splits the data most cleanly. A question is better the more each resulting group contains data with the same answer. For each group, the model again finds the best question and grows a new branch, stopping when no further split is needed or a preset depth is reached. Each leaf at the end holds a classification result such as 'approve/reject' or a numeric prediction such as 'expected amount'. New data starts at the root, answers the questions on the way down, and receives the answer of the leaf it lands on.

Why it matters

Because the model's reasoning can be read directly as rules like 'if this condition, go this way', decision trees are especially welcome in finance, healthcare and the public sector, where the basis for a decision must be explained. They need little preprocessing, such as putting numbers on the same scale, and handle data that mixes numbers and categories well. Above all, decision trees are the basic building block of random forests and gradient boosting, which makes them the starting point for understanding machine learning on tabular data.

Making up for weaknesses with random forests

A single decision tree, as it grows deeper, tends to memorize even chance features of the training data and overfit, and its shape can change a lot when the data changes only slightly. A random forest randomly selects part of the data and part of the candidate questions to build many slightly different trees, then decides the answer by vote for classification and by average for numeric prediction. The trees' mistakes cancel each other out, giving much more stable results, and because the trees can be built at the same time, training is also fast. Gradient boosting differs in that it stacks trees in sequence, with each tree filling in the errors of the previous ones.

One tree vs. a forest vs. boosting

Decision treeA single tree

  • Rules can be read directly
  • Prone to overfitting
  • Shape changes a lot when data changes slightly

Random forestA vote among many separately built trees

  • Many randomly varied trees
  • Mistakes cancel out, so it is stable
  • Fast because trees can be built at the same time

Gradient boostingTrees stacked in sequence

  • Fills in the previous trees' errors
  • High accuracy on tabular data
  • Tuning settings is tricky

공통 All use trees that split data with yes/no questions as their basic building block

All three methods use decision trees as building blocks, but they differ in how many trees they use and how they combine them.

Things to know

When using a single tree, you need to prevent overfitting by limiting its depth or by 'pruning', which cuts off unnecessary branches. With many trees, as in a random forest, accuracy and stability go up, but the rules can no longer be read at a glance as with a single tree. In that case, explanations are supplemented with feature importance, which shows which inputs were used most in making decisions. For unstructured data such as images or sentences, deep learning is often a better fit.

Example

A bank builds a decision tree from loan applicants' information, such as income, existing loans and payment delinquency history, to get readable screening rules like 'Is there a delinquency history? → Is debt high relative to income?', and uses them to explain screening results to customers. When higher accuracy is needed, it trains a random forest on the same data and applies it to problems such as customer churn prediction, defect detection and disease risk classification.

Related terms