What Is a Decision Tree in Machine Learning? A Plain-Language Explanation

Updated · By Viviai

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

  1. Start with the full training set at the root.
  2. Choose a feature that splits the data in a useful way.
  3. Branch into groups and repeat on each group.
  4. Stop when a group is sufficiently pure or a limit is reached.

Classification versus regression

Why people use them

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

Continue with what is clustering and what is overfitting.

Sources

  1. https://www.ibm.com/think/topics/decision-trees
  2. https://scikit-learn.org/stable/modules/tree
  3. http://www.shturl.cc/88c898744e881203717bbffc02d742de

Learn by doing

Read a guide, then practice with bite-sized AI lessons you can take offline.

Start learning free