function that gives the change in tree cost (difference between the node error and the local node error) ==> gives alpha (function g(t) in the Breiman's book)
node_cost(node, tree)
node | the number of the node in the tree |
---|---|
tree | a tree. A data frame returned by the function |
a numeric indicating the change in tree cost (difference between the node error and the local node error). It corresponds to the value of the complexity parameter alpha
.