Learn R Programming

wsrf (version 1.5.47)

predict.wsrf: Predict Method for wsrf Model

Description

Give the predictions for the new data by the forest model built from wsrf.

Usage

"predict"(object, newdata, type=c("response", "class", "prob", "vote", "aprob", "waprob"), ...)

Arguments

object
object of class wsrf.
newdata
the data that needs to be predicted. Its format should be the same as that for wsrf.
type
the type of prediction required, indicating the type of output, and can be one of the values below:
vote
matrix of vote counts

response
predicted values.

class
the same as response.

prob
matrix of class probabilities. The probability is the proportion of trees in the forest voting for the particular outcome (prob = votes / ntrees)

aprob
the average score from the decision trees for each class rather than the proportion of decision trees for each class (aprob = scores / ntrees)

waprob
the weighted average, weighted by the accuracy of the tree (waprob = scores * accuracy / sum(accuracy))

...
Optional additional arguments. At present no additional arguments are used.

Value

nrow(newdata) if given type of response or class, otherwise, a matrix of nrow(newdata) * (number of class label).

See Also

wsrf