← Machine Learning for EveryoneToolsInVisionLearning Center
Core Prediction Models · Lesson 8

Decision Trees: Follow a Sequence of Questions

A decision tree predicts by asking a sequence of questions.

Watch the lesson

Decision Trees: Follow a Sequence of Questions explained visually

1:46

A decision tree predicts by asking a sequence of questions. English captions are optional and start off. The complete transcript follows the written lesson.

Lesson overview

What you will learn

A decision tree predicts by asking a sequence of questions.

  1. Partition the feature space
  2. Control tree complexity
  3. Avoid overinterpreting a split
  4. A worked example
01

Partition the feature space

A decision tree predicts by asking a sequence of questions. Is the temperature above a threshold? Is the route longer than a certain distance? Each answer sends an example down a branch until it reaches a leaf. The leaf supplies a class, a class distribution, or a numerical prediction.

02

Control tree complexity

Training chooses splits that improve a criterion, such as reducing class impurity or squared error. A tree can represent nonlinear relationships and interactions without requiring the same feature scaling as distance-based methods. But a sufficiently deep tree can carve the training data into tiny regions and memorize noise. Limits on depth, leaf size, or pruning can reduce that tendency.

03

Avoid overinterpreting a split

A tree diagram is readable, but readability does not make every split causal or stable. Small data changes may produce a different tree. Check held-out performance and examine whether leaf estimates rely on very few examples. Categorical handling and missing-value behavior vary by implementation, so record those choices. Use a simple tree as a baseline and compare its errors with other models before increasing complexity.

04

A worked example

Suppose a tree predicts late delivery whenever route length exceeds ten kilometers and heavy rain is present. The two conditions create an interaction: the rain question is asked within one branch. That learned rule reflects the training data and may fail if the deployment conditions differ.

Worked example

Suppose a tree predicts late delivery whenever route length exceeds ten kilometers and heavy rain is present. The two conditions create an interaction: the rain question is asked within one branch. That learned rule reflects the training data and may fail if the deployment conditions differ.

Knowledge check

Quick check: test your understanding

Try it yourself: What can happen when a regression tree has one training example in nearly every leaf?

Check the reasoning

It can fit training values extremely closely while producing unstable predictions for new examples.

Why is a printed decision rule not automatically a causal explanation?

The tree learns predictive associations, which may reflect confounding or artifacts in the data.

How would you solve the practice case?

It can fit training values extremely closely while producing unstable predictions for new examples.

What does the worked example show?

Suppose a tree predicts late delivery whenever route length exceeds ten kilometers and heavy rain is present. The two conditions create an interaction: the rain question is asked within one branch. That learned rule reflects the training data and may fail if the deployment conditions differ.

Further reading

Machine Learning — Tom M. Mitchell.

Original ToolsInVision teaching examples. Editorial approach · Suggest a correction

Accessible referenceLesson 8 transcript219 words · Video transcript · Matches the published narration and captionsOpen transcript

A decision tree predicts by asking a sequence of questions. Is the temperature above a threshold? Is the route longer than a certain distance? Each answer sends an example down a branch until it reaches a leaf. The leaf supplies a class, a class distribution, or a numerical prediction.

Training chooses splits that improve a criterion, such as reducing class impurity or squared error. A tree can represent nonlinear relationships and interactions without requiring the same feature scaling as distance-based methods. But a sufficiently deep tree can carve the training data into tiny regions and memorize noise. Limits on depth, leaf size, or pruning can reduce that tendency.

A tree diagram is readable, but readability does not make every split causal or stable. Small data changes may produce a different tree. Check held-out performance and examine whether leaf estimates rely on very few examples. Categorical handling and missing-value behavior vary by implementation, so record those choices. Use a simple tree as a baseline and compare its errors with other models before increasing complexity.

Suppose a tree predicts late delivery whenever route length exceeds ten kilometers and heavy rain is present. The two conditions create an interaction: the rain question is asked within one branch. That learned rule reflects the training data and may fail if the deployment conditions differ.