Algorithm 2 Pruning algorithm |
1. Calculate the information gain of each node. 2. Recursively upwardly from the leaf node of the tree, calculate the loss of the leaf node before and after the parent node: and . If : Prune. 3. Repeat step 2 until it cannot continue. |