Skip to content
Quantoros

Why does minsamplessplit=20 not guarantee that every terminal leaf contains at least 20 observations?

Classic MLLevel: IntermediateLeaf population constraints

Why does min_samples_split=20 not guarantee that every terminal leaf contains at least 20 observations?

Hints
  • Identify which node the parameter checks.
  • One valid parent can produce an imbalanced split.

Answer

It constrains whether a parent may split, not the sizes of resulting children. Use min_samples_leaf to constrain each child's sample count.

Source and licence: scikit-learn 1.7.2 — tree · BSD-3-Clause · answer: Quantoros editorial

Related questions