Skip to contents

Returns the leaf nodes that are responsible for predictions for a given dataset.

Usage

prediction_nodes(yarf_mod, X = NULL, oob_only = TRUE)

Arguments

yarf_mod

A YARF model object.

X

A n* x p data frame where each row is an observation you wish to obtain prediction information. Here, p is the same length as the original training data and the column names match the original training data. If a matrix object is passed in, it is automatically cast to a data frame. This may not always give you what you want. If NULL (the default), then this parameter is set to the model's training data.

oob_only

If X is NULL, setting this to TRUE (the default) will only return node information for trees where each observation is out-of-bag. If X is not NULL, this parameter has no effect on output.

Value

A list where values are rJava YARFNode objects for all the prediction nodes. The first key indexes the row number in X and the second, the tree number.

Author

Kapelner