This function obtains predictions from a random forest based on aggregating the predictions from individual rpart trees. A majority vote is taken for binary classification trees, while the predictions are averaged for normal, poisson, gamma and lognormal regression trees.

# S3 method for rforest
predict(object, newdata)

Arguments

object

fitted model object from the class rforest.

newdata

data frame containing the observations to predict. This argument can only be missing when the random forest in object is trained with keep_data = TRUE. In that case, the original training data will be used to generate predictions.

Value

numeric vector with the averaged predictions (for regression) or the majority vote (for classification) of the individual trees.