Reimplement validation-based pruning (pruneTree) on the kernel Tree.
Depends on Issue 1 (scaffold); best sequenced after Issue 4 (honesty) since both operate as post-build passes over the grown tree.
Scope
- Bottom-up merge-by-validation-gain pass over the kernel
Tree node array: for each internal node whose children are both leaves, if merging them does not reduce the uplift gain on the validation set, collapse them into a leaf. Repeat until no beneficial merge remains.
- Replaces the legacy recursive
pruneTree.
Verify
- Pruning parity vs legacy on a fixed seed (same validation split, same criterion).
Reusable templates
- Legacy:
uplift.pyx pruneTree (~629–784).
- Kernel
Tree node array structure (children_left / children_right / value).
Part of #945.
Reimplement validation-based pruning (
pruneTree) on the kernelTree.Depends on Issue 1 (scaffold); best sequenced after Issue 4 (honesty) since both operate as post-build passes over the grown tree.
Scope
Treenode array: for each internal node whose children are both leaves, if merging them does not reduce the uplift gain on the validation set, collapse them into a leaf. Repeat until no beneficial merge remains.pruneTree.Verify
Reusable templates
uplift.pyxpruneTree(~629–784).Treenode array structure (children_left/children_right/value).Part of #945.