Learn Before
  • Tree pruning

Cost Complexity Pruning

Cost Complexity Pruning is a way to decide how much of the tree to use — how to select a small set of subtrees

Steps to calculating Cost Complexity Pruning:

  1. Calculate total sum of squared residuals for each tree, often starting with the original then reducing by 1 leaf each time.
  2. Calculate a Tree Score for each tree: TreeScore=SSR+αTTree Score = SSR + αT
    • Where αT is the tree complexity penalty — a function of how many leaves are in the given tree, which compensates for the difference in number of leaves between trees.
    • alpha is the tuning parameter we find using cross validation and T is the Terminal, number of leaves.
  3. Pick the tree with the lowest tree score

0

2

6 years ago

Tags

Data Science

Related
  • Cost Complexity Pruning