count_variables {RFlocalfdr}R Documentation

count the number of times each variable is used in a ranger random forest

Description

Usage

count_variables(object)

Arguments

object

a ranger forest object

Value

a table (0-indexed) giving the number of times each variable was used in the random forest

Examples

library(ranger)
rf1 <- ranger(Species ~ ., data = iris,importance="impurity", seed=123)
count_variables(rf1)
rf2 <- ranger(dependent.variable.name = "Species", data = iris,seed=123)
count_variables(rf2)
rf3<- ranger(y = iris[, 5], x = iris[, -5],seed=123)
count_variables(rf3)


[Package RFlocalfdr version 0.8.5 Index]