Decision Tree

BeginnerMachine Learning

Last updated June 14, 2026

What is Decision Tree in simple terms?

In simple terms, a decision tree is a flowchart of questions. It asks one thing, then the next depending on your answer, narrowing step by step until it lands on a conclusion — like troubleshooting why a car won't start.

What is Decision Tree?

A decision tree is a machine learning model that makes a prediction by asking a sequence of simple yes/no questions about the data, branching at each answer until it reaches a final decision — much like a flowchart learned automatically from examples.

A decision tree predicts an outcome by working through a series of simple questions, each one narrowing the possibilities. Start at the top with all your data, ask a question that best splits it — "is the applicant's income above a threshold?" — and send each example down one branch or another based on the answer. At each new branch, ask another question, and another, until you reach the bottom: a leaf that gives the final answer, such as "approve the loan" or "this email is spam." Drawn out, it looks like an upside-down tree, branching from a single root into many leaves. The appeal is that you can read the whole thing like a flowchart and follow exactly why any decision was made.

What makes it a *machine learning* model, rather than a flowchart someone wrote by hand, is that the tree builds itself from examples. Given a pile of past data with known outcomes, the algorithm figures out which question to ask first — the one that most cleanly separates the outcomes — then repeats the process within each branch, choosing the next most useful question, and so on. Nobody tells it that income matters more than the day of the week; it discovers that from the data by seeing which splits sort the examples best. The result is a set of learned if-then rules you can inspect, which is why decision trees are prized when you need to *explain* a model's reasoning, not just trust its output.

The catch is that a single tree, left to grow unchecked, tends to memorize its training data — carving out ever-finer branches for every quirk until it fits the examples perfectly but stumbles on anything new. That's overfitting, and it's the classic weakness of decision trees. The usual fixes are to "prune" the tree back to its genuinely useful questions, or to combine many trees into an ensemble, which is exactly what a random forest does. So while a lone decision tree is wonderfully clear and a great place to start, its real power often shows up when many trees pool their answers.

Real-world example of Decision Tree

Think about how a triage nurse decides how urgently to see someone. They run through quick questions in order: "Trouble breathing?" If yes, top priority straight away. If no: "Severe chest pain?" If yes, urgent. If no: "Fever above a certain level?" — and so on, each answer steering the next question until the patient lands in a category. A decision tree learns to do the same thing, but it works out the questions and their order from thousands of past cases rather than from a nurse's training. It might discover that breathing difficulty is the most telling first question, then learn what to ask within each branch. Anyone can read the finished tree top to bottom and see precisely why a given patient was sorted the way they were — the transparency is the whole point.

Related terms

Frequently asked questions about Decision Tree

What is the difference between a decision tree and a random forest?

A decision tree is a single flowchart of learned questions — easy to read and explain, but prone to overfitting, meaning it can latch onto quirks of its training data and do worse on new cases. A random forest is a crowd of many different decision trees that vote on the answer. Pooling many trees smooths out the mistakes any one of them makes, giving stronger, more reliable predictions. The trade-off: a single tree you can read at a glance; a forest is more accurate but far harder to inspect, since you'd have to read hundreds of trees at once. **2. Mechanism — How does a decision tree work?**

How does a decision tree work?

During training, the algorithm scans the examples and picks the question that best separates the different outcomes — the split that leaves each branch as "pure" (one-outcome-dominated) as possible. It then repeats that within each branch, choosing the next most useful question, growing the tree until the branches are clean enough or a stopping rule kicks in. To make a prediction, you drop a new example in at the top and let the answers route it down the branches to a leaf, which gives the verdict. Often the tree is then pruned — trimmed back — to remove over-specific branches that hurt accuracy on new data. **3. Application — What is a decision tree used for?**

What is a decision tree used for?

Decision trees handle both classification (sorting into categories, like approve/decline) and regression (predicting a number, like a price). They're especially valued where the reasoning must be transparent and auditable — credit scoring, medical decision support, eligibility rules — because you can show the exact path to any decision. They also serve as the building blocks of powerful ensemble methods like random forests and gradient-boosted trees, so even when they're not used alone, they're working under the hood of some of the most effective models in practice.