liveBook · Manning

Leaf node

As explained in Machine Learning Algorithms in Depth

A leaf node is a terminal node of a decision tree representing an input region and its prediction.

A leaf node is a terminal region of a decision tree. Classification assigns the region’s majority class; regression assigns its expected value. section 5.6

A leaf node serves three connected purposes:

  • Represents an axis-parallel region produced by recursive binary splits. section 5.6
  • Summarizes the labels assigned to its contained data points through a majority vote or expected value. section 5.6
  • Provides the unit whose purity is optimized while tree depth is controlled to limit overfitting. section 5.6

A leaf in a from-scratch implementation

A TreeNode stores the node’s Gini value, sample count, class counts, and class label, alongside split metadata and left and right child links. A terminal node uses the stored region statistics for prediction. section 5.6

How Machine Learning Algorithms in Depth covers it

How deep it goes
Defines regions and predictions, then connects purity to Gini optimization and depth control without deriving terminal-node internals.
Examples
Uses axis-parallel input regions, majority-class classification, expected-value regression, and a TreeNode implementation.
What it assumes
Assumes decision-tree training with features, thresholds, classes, and impurity objectives.
What you can do after
Build it from scratch by representing terminal-node statistics within a recursive CART classifier.
How it connects
Connects leaf nodes to decision trees, CART, recursive partitioning, majority vote, expected value, Gini impurity, entropy, and overfitting.

Also explained in

Compare how 10 books explain leaf node →

Related concepts

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