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

Description Usage Arguments Value Examples

View source: R/plotting_util.R

Description

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

Usage

1
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

1
2
3
4
5
require(survival)
library(ranger)
rg.veteran <- ranger(Surv(time, status) ~ ., data = veteran, write.forest =
TRUE)
result <- getAndPlotMetric(rg.veteran)

climbeR documentation built on May 2, 2019, 3:37 p.m.