stop_max_depth: Maximum-depth stopping rule.

View source: R/stop-strategy.R

stop_max_depthR Documentation

Maximum-depth stopping rule.

Description

Creates a stopping rule that stops splitting when a node's depth reaches max_depth. Depth is zero-based at the root, so max_depth(k) allows at most k + 1 levels. Mode-agnostic: useful for bounding tree complexity in both classification and regression trees.

Usage

stop_max_depth(max_depth)

Arguments

max_depth

Maximum depth (non-negative integer; 0 produces a root-only stump).

Value

A stop_strategy object.

See Also

stop_min_size, stop_any

Examples

stop_max_depth(5)


ppforest2 documentation built on July 21, 2026, 9:07 a.m.