Learn R Programming

climbeR (version 0.0.1)

getAndPlotMetric: Calculate the metric and make Second Order vs First Order plot

Description

Comprehensive function for calculating minimal depth of a maximal subtree averaged over the forest and then plotting the result.

Usage

getAndPlotMetric(ranger_result, plot_missing_so = FALSE)

Arguments

ranger_result
A ranger object from the ranger package, which was created setting param write.forest to TRUE. In other words, it must have a 'forest' property.
plot_missing_so
An optional parameter to show features that only have a first order metric value. Variables can have high feature strength, but may be unlikely to have a second maximal subtree because of low cardinality.

Value

a list; element 1 is a data.frame containing subtree depth data, element 2 is the plot of number of splits vs first order metric, element 3 is a plot of second order vs first order.

Examples

Run this code
require(survival)
library(ranger)
rg.veteran <- ranger(Surv(time, status) ~ ., data = veteran, write.forest =
TRUE)
result <- getAndPlotMetric(rg.veteran)

Run the code above in your browser using DataLab