Decision Tree

A decision tree is like a question game. It asks simple yes-or-no questions until it reaches an answer.

What it does

A decision tree is like a question game. It asks simple yes-or-no questions until it reaches an answer.

Root: Starting question • Leaf: Final outcome

How it works

  • Start with one question at the top.
  • Follow the yes or no path that matches the item.
  • Stop at the final box. That box is the answer.

Uses and applications

  • A store can decide which shelf a product belongs on by asking questions like “Is it food?” or “Is it fragile?”
  • A game can guess an animal by asking questions like “Can it fly?”
  • A website can help support teams send a question to the right person.

In short

It works like 20 Questions. It keeps asking simple questions until it reaches a final label.

Related methods

  • Random Forest: Combines many decision trees and lets them vote.
  • Gradient Boosting: Adds small trees one after another, each correcting earlier errors.
  • KNN (Neighbors): Classifies by nearby examples instead of learned questions.

Back to Prediction and classification · All topics

The interactive demonstration and the Python walkthrough for this topic need JavaScript.