findTestPreds {forestError} | R Documentation |
Predicts each test observation's response using the random forest and, for each test observation and tree, finds the terminal node of the tree in which the test observation falls.
findTestPreds(forest, X.test, n.cores = 1)
forest |
The random forest object being used for prediction. |
X.test |
A |
n.cores |
Number of cores to use (for parallel computation in |
This function accepts regression random forests built using the randomForest
,
ranger
, randomForestSRC
, and quantregForest
packages.
A data.table
with the following four columns:
rowid_test |
The row ID of the test observation as provided by |
pred |
The random forest prediction of the test observation |
tree |
The ID of the tree of the random forest |
terminal_node |
The ID of the terminal node of the tree in which the test observation falls |
Benjamin Lu <b.lu@berkeley.edu>
; Johanna Hardin <jo.hardin@pomona.edu>
findOOBErrors
, quantForestError