Skip to content
Quantoros

What is penalized by ccpalpha in cost-complexity tree pruning?

Classic MLLevel: IntermediateCost-complexity penalty

What is penalized by ccp_alpha in cost-complexity tree pruning?

Hints
  • Complexity is measured by leaves.
  • Pruning trades fit against structure size.

Answer

It adds a penalty proportional to the number of terminal nodes to the subtree's impurity cost. Larger alpha favors smaller subtrees; select it using validation rather than training impurity alone.

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

Related questions