addSurrogates: Add surrogate information that was created by getTreeranger

View source: R/addSurrogates.R

addSurrogatesR Documentation

Add surrogate information that was created by getTreeranger

Description

This function adds surrogate variables and adjusted agreement values to a forest that was created by getTreeranger.

Usage

addSurrogates(RF, trees, s, Xdata, num.threads)

Arguments

RF

random forest object created by ranger (with keep.inbag=TRUE).

trees

list of trees created by getTreeranger.

s

Predefined number of surrogate splits (it may happen that the actual number of surrogate splits differes in individual nodes). Default is 1 % of no. of variables.

Xdata

data without the dependent variable.

num.threads

number of threads used for parallel execution. Default is number of CPUs available.

Value

a list with trees containing of lists of nodes with the elements:

  • nodeID: ID of the respective node (important for left and right daughters in the next columns)

  • leftdaughter: ID of the left daughter of this node

  • rightdaughter: ID of the right daughter of this node

  • splitvariable: ID of the split variable

  • splitpoint: splitpoint of the split variable

  • status: "0" for terminal and "1" for non-terminal

  • layer: layer information (0 means root node, 1 means 1 layer below root, etc)

  • surrogate_i: numbered surrogate variables (number depending on s)

  • adj_i: adjusted agreement of variable i


StephanSeifert/SurrogateMinimalDepth documentation built on Aug. 7, 2023, 1:59 a.m.