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.

# S3 method for class 'SDForest'
varImp(object)

Arguments

object

an SDForest object

Value

A named vector of variable importance

Author

Markus Ulmer

Examples

data(iris)
fit <- SDForest(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, 
                 iris, nTree = 10, cp = 0.5)
varImp(fit)
#>  Sepal.Width Petal.Length  Petal.Width 
#>    0.0000000    0.0474703    0.0000000