⚡ A decision tree is a machine learning model that predicts by asking a series of yes/no questions about the data — branching at each answer until it reaches a final decision. It is the most interpretable ML model: you can trace exactly why it made every prediction. It is also the foundation of Random Forests and boosting algorithms like XGBoost.
Category: Machine Learning · Difficulty: Beginner · Last updated: 15 May 2026 · 5 min read
Decision Tree — What It Is, How It Makes Decisions & Why It Is the Most Interpretable ML Model
What is Decision Tree?
A doctor deciding whether to admit a patient does not run a neural network. They run a mental decision tree. Is the patient’s oxygen level below 90%? Yes → admit immediately. No → is there chest pain? Yes → run ECG. No → is there fever above 38°C? Yes → check for infection. Every branching question narrows the possibilities until a decision is reached.
Machine learning decision trees work identically — except instead of a doctor’s experience encoding the questions, an algorithm learns the best questions from training data. Which question about the features best separates the sick from the healthy? Which income threshold best separates the loan defaulters from the reliable borrowers? The algorithm finds those questions automatically and arranges them into a tree structure.
How Decision Tree works
- Start at the root with all training examples.
- The algorithm evaluates every possible question (feature value split) and picks the one that best separates the classes — measured by Gini impurity or information gain.
- The data is split into two branches based on the answer to that question.
- The process repeats recursively for each branch — finding the best question for the remaining data at each node.
- Splitting stops when a branch contains only one class, or a stopping criterion (max depth, minimum samples) is met.
- Each leaf node contains a final prediction — the majority class of training examples that landed there.
Real-world examples
Not theory — what real teams actually shipped using this technique.
- Medical triage systems use decision trees to classify patient urgency — a sequence of vital sign checks produces a triage category (immediate, urgent, less urgent) that is transparent and auditable.
- FICO credit scoring uses decision tree logic (among other methods) to classify loan applicants — regulators require that rejected applicants receive an explanation, which decision trees naturally provide.
- Fraud detection rules in banking often start as decision tree models — which combinations of transaction features most reliably distinguish fraud — then get converted to simple if/then rules for real-time deployment.
Common pitfalls
- Overfitting — deep trees memorise training data. Always constrain max depth, min samples per leaf, or use post-pruning.
- Instability — small changes in data can produce very different trees. A slightly different training set can flip the root question entirely. Ensemble methods (Random Forests) solve this by averaging many trees.
- Greedy splits — the algorithm picks the locally best split at each node, which may not produce the globally best tree. This is a fundamental limitation of how trees are built.
- Linear boundaries only at right angles — decision trees split at fixed feature thresholds and struggle with diagonal or curved class boundaries. For complex patterns, neural networks or kernel methods outperform them.
Frequently asked questions
QUESTION 1 What is a decision tree in simple terms?
ANSWER 1 A tree of yes/no questions about your data. The answer to each question sends you to the next, until you reach a final prediction. A doctor’s mental triage process is a decision tree.
QUESTION 2 How does a decision tree learn from data?
ANSWER 2 It finds the question at each node that best separates the classes — measured by Gini impurity or information gain — and repeats recursively until leaves are pure.
QUESTION 3 What is the main weakness of decision trees?
ANSWER 3 Overfitting — deep trees memorise training data. Solved by constraining depth, requiring minimum samples, or using ensemble methods like Random Forests and XGBoost.
QUESTION 4 When should you use a decision tree?
ANSWER 4 When interpretability is essential — regulators, doctors, or loan officers need to understand exactly why a decision was made. Also, as a fast baseline before trying more complex models.
📬 Get one concept + one use case every Tuesday. Join the newsletter →