localvimp: Partially Recursively Induced Structured Moderation

Description Usage Arguments Details Value References Examples

View source: R/localvimp.R

Description

Calculate local vimp for each termianl node for prism or hprism tree.

Usage

1
localvimp(l, hvar = NULL, M = 30, dat, cp.prism = 0)

Arguments

l

An rpart output for prism or hprism tree.

hvar

The hierarchical level variable for hprism tree, which is specified within double quotes. If unspecified, local vimp for prism tree is calculated.

M

Times of iterations for calculating local vimp, default is 30.

dat

The same data frame used to generate the prism or hprism object.

cp.prism

The same value specified as the one used to generated the prism or hprism object.

Details

Variable importance was originally designed for tree-based models using measures involving surrogate variables. Other measures based on mean overall improvement in node impurity for a tree have also been proposed. One interesting such measure is called variable importance (vimp) which uses a prediction error approach involving "noising-up" a variable at a time and examining the difference in prediction error when a variable is noised-up by permuting its value randomly, compared to prediction error under the original predictor. Variables with large vimp values are ranked highly in terms of variable importance. In our setting however, we want to understand the individual level variables that are driving each terminal node - so a local vimp (Lvimp). In order to do this, we must condition on the observations in a terminal node while we apply the noising-up procedure variable by variable and re-building the entire tree. Differences in prediction errors are evaluated only using those observations in the terminal node of interest.

Value

A list with components

References

H. Ishwaran, “Variable importance in binary regression trees and forests,” Electronic Journal of Statistics, vol. 1, pp. 519–537, 2007.

Examples

1
2
3
4
5
6
## Not run: 
lp1<-localvimp(l.prism, M=10, dat=Leuk, cp.prism=0)
lp2<-localvimp(l.hprism, hvar="tpi.m", M=10, dat=Leuk, cp.prism=0)
lp3<-localvimp(l.hprism1, hvar="tpi.m", M=10, dat=Leuk, cp.prism=0)

## End(Not run)

yuhuilin619/prism documentation built on July 18, 2019, 5:41 p.m.