Learn R Programming

SDModels (version 1.0.4)

varImp.SDTree: Extract variable importance of an SDTree

Description

This function extracts the variable importance of an SDTree. The variable importance is calculated as the sum of the decrease in the loss function resulting from all splits that use this covariate.

Usage

# S3 method for SDTree
varImp(object)

Value

A named vector of variable importance

Arguments

object

an SDTree object

Author

Markus Ulmer

See Also

varImp.SDForest SDTree

Examples

Run this code
data(iris)
tree <- SDTree(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, iris, cp = 0.5)
varImp(tree)

Run the code above in your browser using DataLab