What Is a Decision Tree in Machine Learning? A Plain-Language Explanation
A decision tree is a supervised machine learning algorithm that uses a tree-like set of simple if-then rules to classify data or predict a value, branching from a root question through internal nodes down to leaf-node outcomes. It is used for both classification and regression tasks.
The simple analogy
Think of the game of twenty questions. Each question splits the possibilities, and each answer narrows them until you reach a final answer. A decision tree works the same way, asking one feature question at a time.
The parts of a tree
| Part | Meaning |
|---|---|
| Root node | The first question that splits the data |
| Internal node | A further question after a branch |
| Branch | One possible answer to a question |
| Leaf node | A final prediction with no more splits |
How it learns
- Start with the full training set at the root.
- Choose a feature that splits the data in a useful way.
- Branch into groups and repeat on each group.
- Stop when a group is sufficiently pure or a limit is reached.
Classification versus regression
- Classification trees predict a category, such as yes or no.
- Regression trees predict a number, such as an expected price.
Why people use them
- The flowchart structure is relatively easy to interpret.
- Rules can be explained without advanced math.
- They can handle both categorical and numerical data.
Honest caveats
A single deep tree can overfit and become unstable, where small data changes produce a very different tree. Practitioners often limit depth or combine trees, such as with random forests. A decision tree is a useful interpretable model, not a guarantee of accuracy.
FAQ
Is a decision tree supervised or unsupervised?
It is a supervised method, learning from labeled examples.
What is a leaf node?
The endpoint of a branch that holds a final prediction.
Can decision trees predict numbers?
Yes. Regression trees predict numerical values rather than categories.
Why do trees overfit?
A tree that grows too deep can memorize training details, including noise, instead of learning general rules.
Key takeaways
- A decision tree makes predictions through if-then rules in a tree structure.
- It supports classification and regression.
- Its visual rules are relatively easy to explain.
- Depth control and tree ensembles help reduce overfitting.
Continue with what is clustering and what is overfitting.
Sources
Learn by doing
Read a guide, then practice with bite-sized AI lessons you can take offline.
Start learning free