EasyDeepLearn

How does cost-complexity (CCP) pruning work?

hard

Answer

  • Grow the tree fully.
  • Define Rα(T)  =  R(T)  +  αR_{\alpha}(T)\; = \;R(T)\; + \;\alpha * |T|, where R(T) is the training error, |T  isT \mid \;\mathrm{is} the number of leaves, and alpha ≥ 0 penalizes complexity.
  • For each alpha, the subtree minimizing RαR_{\alpha} is unique and nested — you get a full sequence of subtrees indexed by alpha.
  • Pick alpha via cross-validation on the sequence.
  • Scikit-learn exposes it via costcomplexitypruning\mathrm{cost}_{\mathrm{complexity}}\mathrm{pruning}_path and the ccpα\mathrm{ccp}_{\alpha} argument.
Check yourself — multiple choice
  • Prune every leaf equally
  • Trade off training error and tree size via alpha; CV over alpha selects the subtree
  • Cost-complexity is only for random forests
  • It grows the tree until the training error is zero

CCP: Rα(T)  =  R(T)  +  αTR_{\alpha}(T)\; = \;R(T)\; + \;{\alpha} \mid T|. Sequence of nested subtrees; CV over α.

#decision-trees#trees#regularization

Practise Supervised Learning

215 interview questions in this topic.

Related questions