liveBook · Manning

Stopping criterion

As explained in Grokking Machine Learning, Second Edition

A rule that determines when a recursive algorithm should stop further processing or subdivision.

A stopping criterion tells a recursive decision-tree algorithm when to stop splitting data. Without one, leaves can become tiny and the tree may overfit. A node can stop when its samples are already pure, or when a chosen limit prevents further subdivision. section 9.5

Common stopping criteria include:

  • Stop when the improvement in accuracy, Gini index, or entropy falls below a threshold. section 9.5
  • Stop when a node contains fewer than a specified number of samples. section 9.5
  • Allow a split only when both resulting leaves contain enough samples. section 9.5
  • Stop after the tree reaches a specified maximum depth. section 9.5

Stopping during tree construction

The algorithm repeatedly selects a leaf, finds its best feature split, and checks the stopping criteria. If splitting is allowed, it creates two new leaves; otherwise, the node remains a leaf and predicts its samples’ most common label. In an app-recommendation tree, traversal ends at such a leaf to recommend Atom Count, Beehive Count, or Check Mate Mate. section 9.6

How Grokking Machine Learning, Second Edition covers it

How deep it goes
Enumerates four practical criteria and their hyperparameters, then embeds them in a step-by-step tree-building procedure.
Examples
Uses pure leaves, sample-count limits, depth limits, and an app-recommendation decision tree to illustrate stopping.
What it assumes
Assumes recursive data splitting and a selected metric such as accuracy, Gini index, or entropy.
What you can do after
Configure decision-tree growth and determine the majority-label prediction when a split is disallowed.
How it connects
Connects decision trees with hyperparameters, overfitting, accuracy, Gini index, entropy, validation sets, and grid search.

Also explained in

Compare how 14 books explain stopping criterion →

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.