I'm using varimportance function from the classregtree package. I would like to know the theory behind this function since the Matlab help is very light.
If you split parent node 1 into child nodes 2 and 3, you increase the importance of the split variable by
(R1 - R2 - R3)/Nnode
where Ri are node risks and Nnode is the total number of nodes in this tree. Risk is defined as
Ri = Pi*Ei
where Pi is the node probability and Ei is either node error (for trees grown by minimizing a non-impurity criterion such as MSE or the twoing criterion) or node impurity (for trees grown by minimizing an impurity criterion such as Gini index or deviance).
Is this what you are looking for? If yes, can you say why this was not clear to you from the documentation?
The prediction of a regression tree is the mean of observed responses over observations landing on this node. If you passed in observation weights, the prediction is the weighted mean.
Best Answer