Learn R Programming

SDModels (version 1.0.4)

varImp.SDForest: Extract variable importance of an SDForest

Description

This function extracts the variable importance of an SDForest. The variable importance is calculated as the sum of the decrease in the loss function resulting from all splits that use a covariate for each tree. The mean of the variable importance of all trees results in the variable importance for the forest.

Usage

# S3 method for SDForest
varImp(object)

Value

A named vector of variable importance

Arguments

object

an SDForest object

Author

Markus Ulmer

See Also

varImp.SDTree SDForest

Examples

Run this code
data(iris)
fit <- SDForest(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, 
                 iris, nTree = 10, cp = 0.5)
varImp(fit)

Run the code above in your browser using DataLab