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)

Arguments

node

the number of the node in the tree tree

tree

a tree. A data frame returned by the function CARTGV and which summarizes the resulted CARTGV tree.

Value

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.