View source: R/query.rf.pred.val.R
query.rf.pred.val | R Documentation |
ranger
The observed values (for the response variable) constituting the terminal
node associated with each observation are queried using the ranger
object and the training data.
The parameter keep.inbag = TRUE
should be applied to call to
ranger
.
query.rf.pred.val(obj, data, id.name = FALSE, unique.by.id = FALSE, ...)
obj |
An R object of class |
data |
Input for training data. |
id.name |
Use the IDs of the terminal nodes as names for the lists. |
unique.by.id |
Only return results of unique terminal node IDs. |
... |
Other parameters (will be ignored). |
The observations are found based on terminal node IDs. It should be noted that the out-of-bag observations are not present in the indexes.
A nested list of length num.trees
.
Shangzhi Hong
data(iris) rfObj <- ranger( Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species, data = iris, num.trees = 5, keep.inbag = TRUE) outList <- query.rf.pred.val(rfObj, iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.