Learn R Programming

CERFIT (version 0.1.1)

MinDepth: Calculate Variable Importance

Description

Calculates the average minimal depth of each predictor used to fit a CERFIT object. It calculates Variables importance by using a Variables average minimal depth. variable's with a lower average minimal depth are more important.

Usage

MinDepth(cerfit)

Value

Returns a named vector with the name of each predictor used to fit the CERFIT object and its corresponding average minimal depth across all trees

Arguments

cerfit

A fitted CERFIT object

Details

The depth of the root node is zero and if a variable does not appear at any split in a tree it is assigned maxdepth + 1 for that tree.

Examples

Run this code
fit <- CERFIT(Result_of_Treatment ~ sex + age + Number_of_Warts + Area + Time + Type | treatment,
data = warts,
ntrees = 30,
method = "RCT",
mtry = 2)
importance <- MinDepth(fit)

Run the code above in your browser using DataLab