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 = parallel::detectCores(),
preschedule.threads = TRUE
)
Arguments
- RF
A ranger::ranger object which was created 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 differs in individual nodes).
- Xdata
data without the dependent variable.
- num.threads
(Default:
parallel::detectCores()
) Number of threads to spawn for parallelization.- preschedule.threads
(Default: TRUE) Passed as
mc.preschedule
toparallel::mclapply()
.
Value
A list of trees. A list of 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 noderightdaughter
: ID of the right daughter of this nodesplitvariable
: ID of the split variablesplitpoint
: splitpoint of the split variablestatus
:0
for terminal and1
for non-terminallayer
: 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