Learn R Programming

BigTSP (version 1.0)

predict.tsp.randomForest: prediction function for tsp.randomForest

Description

prediction function for tsp.randomForest

Usage

"predict"(object, newdata, type = "response", norm.votes = TRUE, predict.all = FALSE, proximity = FALSE, nodes = FALSE, cutoff, ...)

Arguments

object
a tsp.randomForest object
newdata
new data matrix
type
one of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts. class is allowed, but automatically converted to ''response", for backward compatibility.
norm.votes
Should the vote counts be normalized (i.e., expressed as fractions)?
predict.all
Should the predictions of all trees be kept?
proximity
Should proximity measures be computed?
nodes
Should the terminal node indicators (an n by ntree matrix) be return? If so, it is in the ''nodes" attribute of the returned object.
cutoff
A vector of length equal to number of classes. The 'winning' class for an observation is the one with the maximum ratio of proportion of votes to cutoff.
...
not used.

References

randomForest package.

Examples

Run this code
library(randomForest)
x=matrix(rnorm(100*20),100,20)
y=rbinom(100,1,0.5)
y=as.factor(y)
fit=tsp.randomForest(x,y)
predict(fit,x[1:10,])

Run the code above in your browser using DataLab