predict.wsrf: Predict Method for 'wsrf' Model

Description Usage Arguments Value Author(s) See Also

Description

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

Usage

1
2
3
 ## S3 method for class 'wsrf'
predict(object, newdata, type=c("response",
  "class", "vote", "prob", "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, a character vector indicating the types 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 / ntree)

aprob

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

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

a list of predictions for the new data with corresponding components for each type of predictions. For type=class or type=class, a vector of length nrow(newdata), otherwise, a matrix of nrow(newdata) * (number of class label). For example, if given type=c("class", "prob") and the return value is res, then res$class is a vector of predicted class labels of length nrow(newdata), and res$prob is a matrix of class probabilities.

Author(s)

He Zhao and Graham Williams (SIAT, CAS)

See Also

wsrf


wsrf documentation built on May 2, 2019, 4:04 p.m.