Prediction with new data and a saved forest from unityfor.
# S3 method for unityfor
predict(
object,
data = NULL,
predict.all = FALSE,
num.trees = object$num.trees,
type = "response",
num.threads = NULL,
verbose = TRUE,
...
)Object of class unityfor.prediction with elements
predictions | Predicted classes/probabilities/values (only for classification and regression) |
num.trees | Number of trees. |
num.independent.variables | Number of independent variables. |
treetype | Type of forest/tree. Classification or regression (the latter is not implemented yet). |
num.samples | Number of samples. |
unityfor object.
New test data of class data.frame.
Return individual predictions for each tree instead of aggregated predictions for all trees. Return a matrix (sample x tree) for classification and a 3d array for probability estimation (sample x class x tree).
Number of trees used for prediction. The first num.trees in the forest are used.
Type of prediction. One of 'response', 'se', 'terminalNodes', 'quantiles' with default 'response'. See below for details.
Number of threads. Default is number of CPUs available.
Verbose output on or off.
further arguments passed to or from other methods.
Marvin N. Wright
This package is a fork of the R package 'ranger' that implements random forests using an efficient C++ implementation. More precisely, 'unityForest' was written by modifying the code of 'ranger', version 0.11.0.
Hornung, R., Hapfelmeier, A. (2026). Unity Forests: Improving Interaction Modelling and Interpretability in Random Forests. arXiv:2601.07003, <tools:::Rd_expr_doi("10.48550/arXiv.2601.07003")>.
Wright, M. N., Ziegler, A. (2017). ranger: A fast Implementation of Random Forests for High Dimensional Data in C++ and R. Journal of Statistical Software 77:1-17, <tools:::Rd_expr_doi("10.18637/jss.v077.i01")>.
unityfor