Calculates variable importance using results from previous varpro call.

importance(o, local.std = TRUE, y.external = NULL,
  cutoff = 0.79, trim = 0.1, plot.it = FALSE, conf = TRUE, sort = TRUE,
  ylab = if (conf) "Importance" else "Standardized Importance",
  max.rules.tree, max.tree,
  papply = mclapply,
  ...)

Arguments

o

VarPro object obtained from previous call to varpro.

local.std

Use locally standardized importance?

y.external

User supplied external y value. Must match the dimension and be appropriate for the family.

cutoff

Cut-off used to highlight significant variables in the importance graphical plot. Only applies when option plot.it='TRUE'.

trim

Used for setting windsorized trim value to robustify mean and standard deviation values.

plot.it

Plot the importance values?

conf

Show importance values with standard errors as a boxplot (thus showing an informal confidence region)? If conf='FALSE', plots standardized importance.

sort

Sort the results in decreasing order?

ylab

Label used for vertical axis.

max.rules.tree

Optional. Maximum number of rules per tree. If left unspecified, uses the value from the VarPro object.

max.tree

Maximum number of trees used for extracting rules. If left unspecified, uses the value from the VarPro object.

papply

Use mclapply or lapply.

...

Additional options.

Details

Calculates split-sample mean and standard deviation importance values using the results from a previous varpro call and converts these to standardized importance values from which variables are selected.

Value

Invisibly, table summarizing the results. Contains mean importance 'mean', the standard deviation 'std', and standardized importance 'z'.

For classification, conditional 'z' tables are additionally provided, where the $z$ standardized importance values are conditional on the class label.

See cv.varpro for a data driven cross-validation method for selecting the cutoff value, cutoff.

Author

Min Lu and Hemant Ishwaran

References

Lu, M. and Ishwaran, H., (2024). Model-independent variable selection via the rule-based variable priority. arXiv e-prints, pp.arXiv-2409.

See also

Examples

# \donttest{

## ------------------------------------------------------------
## regression example
## ------------------------------------------------------------

data(BostonHousing, package = "mlbench")

## call varpro
o <- varpro(medv~., BostonHousing)

## extract importance values
imp <- importance(o)
print(imp)

## plot the results
imp <- importance(o, plot.it = TRUE)
print(imp)


## ------------------------------------------------------------
## illustrates y-external: regression example
## ------------------------------------------------------------

## friedman1 - standard application of varpro
d <- data.frame(mlbench:::mlbench.friedman1(250),noise=matrix(runif(250*10,-1,1),250))
o <- varpro(y~.,d)
print(importance(o))

## importance using external rf predictor
print(importance(o,y.external=randomForestSRC::rfsrc(y~.,d)$predicted.oob))

## importance using external lm predictor
print(importance(o,y.external=lm(y~.,d)$fitted))

## importance using external randomized predictor
print(importance(o,y.external=sample(o$y)))

## ------------------------------------------------------------
## illustrates y-external: classification example
## ------------------------------------------------------------

## iris - standard application of varpro
o <- varpro(Species~.,iris)
print(importance(o))

## importance using  external rf predictor
print(importance(o,y.external=randomForestSRC::rfsrc(Species~.,iris)$class.oob))

## importance using  external randomized predictor
print(importance(o,y.external=sample(o$y)))

## ------------------------------------------------------------
## illustrates y-external: survival
## ------------------------------------------------------------
data(pbc, package = "randomForestSRC")
o <- varpro(Surv(days, status)~., pbc)
print(importance(o))

## importance using  external rsf predictor
print(importance(o,y.external=randomForestSRC::rfsrc(Surv(days, status)~., pbc)$predicted.oob))

## importance using  external randomized predictor
print(importance(o,y.external=sample(o$y)))


# }