liveBook · Manning

Root node

As explained in Grokking Machine Learning

The top node of a decision tree associated with the complete input dataset before any split.

Imagine deciding whether to wear a jacket: the first question—“Is it raining?”—starts the decision process. In a decision tree, that topmost starting point is the root node. It contains the first yes-or-no question and represents the entire input dataset before any split. section 9.0

The root node establishes how a decision tree begins:

  • Assign it level 0 and associate it with every training sample and its labels. section 9.2
  • Evaluate features at the node and select a split using a metric such as accuracy, Gini index, or entropy. section 9.2
  • Turn it into a decision node when splitting is allowed; otherwise, keep it as a leaf and assign the most common label. section 9.2
  • A decision stump contains only the root node and two leaves, representing one immediate yes-or-no decision. section 9.0

Seeing the root in a geometric classifier

For a dataset with features x0 and x1, the root node corresponds to the first vertical boundary at x0 = 5. Its two sides become branches, and later horizontal boundaries split those branches further. section 9.4

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 tree diagram to trace the root's first question, its branches, later decision nodes, leaves, and overall depth. section 9.0

How Grokking Machine Learning covers it

How deep it goes
Defines the root as a topmost level-0 node and explains its conversion into a decision node or leaf during training.
Examples
Illustrates jacket decisions, app recommendations, and geometric boundaries at x0 = 5.
What you can do after
Builds a decision tree by associating the root with all training data and selecting its first feature split.
How it connects
Connects decision trees with decision nodes, branches, leaves, decision stumps, and Gini index or entropy.

Also explained in

Compare how 5 books explain root node →

Related concepts

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