If object$type
is regression
, a vector of predicted
values is returned. If predict.all=TRUE
, then the returned
object is a list of two components: aggregate
, which is the
vector of predicted values by the forest, and individual
, which
is a matrix where each column contains prediction by a tree in the
forest.
If object$type
is classification
, the object returned
depends on the argument type
:
responsepredicted classes (the classes with majority vote).
probmatrix of class probabilities (one column for each class
and one row for each input).
votematrix of vote counts (one column for each class
and one row for each new input); either in raw counts or in fractions
(if norm.votes=TRUE
).
If predict.all=TRUE, then the individual component of the
returned object is a character matrix where each column contains the
predicted class by a tree in the forest.
If proximity=TRUE, the returned object is a list with two
components: pred is the prediction (as described above) and
proximity is the proximitry matrix. An error is issued if
object$type is regression.
If nodes=TRUE, the returned object has a ``nodes'' attribute,
which is an n by ntree matrix, each column containing the node number
that the cases fall in for that tree.
NOTE: If the object inherits from randomForest.formula,
then any data with NA are silently omitted from the prediction.
The returned value will contain NA correspondingly in the
aggregated and individual tree predictions (if requested), but not in
the proximity or node matrices.
NOTE2: Any ties are broken at random, so if this is undesirable, avoid it by
using odd number ntree in randomForest().