liveBook · Manning

Decision node

As explained in Grokking Machine Learning, Second Edition

An internal tree node associated with a feature-based decision that divides its samples into branches.

A decision node represents a yes-or-no question in a decision tree. It has two branches: one for each possible answer. A node that cannot be split further becomes a leaf instead. section 9.0

Choosing whether to wear a jacket

A tree might first ask, “Is it raining?” If yes, it leads to a jacket decision. If no, another decision node can ask whether the temperature is hot or cold. A one-question tree is called a decision stump. section 9.0

During tree construction, a decision node follows this pattern:

  • Select a feature that splits the node’s samples well according to the chosen metric. section 9.6
  • Create two branches and attach the corresponding samples to new child nodes. section 9.6
  • Keep the node as a decision node when splitting is allowed; otherwise assign the most common label and make it a leaf. section 9.4 section 9.6
Figure 9.2 A regular decision tree with a root node, decision nodes, branches, and leaves. Note that each decision node contains a yes-or-no question. From each possible answer, one branch emanates, which can lead to another decision node or a leaf. This tree has a depth of 2, because the longest path from a leaf to the root goes through two branches.

Use the diagram to see how questions, branches, decision nodes, and leaves form a binary decision tree. section 9.0

How Grokking Machine Learning, Second Edition covers it

How deep it goes
Defines branching and stopping, then shows feature selection, sample splitting, stopping conditions, and leaf prediction.
Examples
Uses jacket choices and app recommendations to demonstrate branching, splitting, and predictions.
What you can do after
Build it from scratch by selecting splits, creating branches, assigning leaf labels, and traversing the resulting tree.
How it connects
Connects decision trees with root nodes, leaf nodes, branches, features, Gini impurity, and entropy.

Also explained in

Compare how 5 books explain decision node →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Machine Learning, Second Edition. The section links point to the parts of the book it draws on.