Learn R Programming

randomUniformForest (version 1.0.6)

predict.randomUniformForest: Predict method for random Uniform Forests objects

Description

Prediction of test data using random Uniform Forests.

Usage

## S3 method for class 'randomUniformForest':
predict(object, X, 
	type = c("response", "prob", "votes", "confInt", 
	"ranking", "quantile", "truemajority", "all"),
	classcutoff = c(0,0), 
	conf = 0.95,
	whichQuantile = NULL,
	rankingIDs = NULL,
	threads = "auto", 
	parallelpackage = "doParallel",
	...)

Arguments

object
an object of class randomUniformForest, as one created by the randomUniformForest() function.
X
a data frame or matrix containing new data (without response values).
type
one of response, prob, votes, prediction intervals, ranking, quantile, true majority or raw outputs, indicating respectively the type of output: 'predicted values', 'matrix of class probabilities', 'matrix of vote counts', 'prediction interval for each re
classcutoff
conf
if type == "confInt", value of 'conf' (greater than 0 and lesser than 1) is the desired level of confidence for prediction interval.
whichQuantile
if type == "quantile", value of 'whichQuantile' is the desired quantile (greater than 0 and lesser than 1).
rankingIDs
experimental. If type == "ranking", vector of ID if one wants to rank responses instead of classify them. Ranking usually involves many same users (or objects, or items) whose choices have to be ranked, e.g., by a recommendation engine. For example, if 'u
parallelpackage
...
not used currently.

Value

  • responsepredicted values. Default option that returns values in the same way than original training responses.
  • probfor classification only. Matrix of class probabilities.
  • votesmatrix of vote counts. Each row is an observation and each columns is tree output.
  • confIntfor regression only. Matrix where each row is an observation and each column one of the prediction interval bounds.
  • quantilefor regression only. Vector of predicted quantiles for 'conf' (value of the option) level of confidence.
  • rankinga matrix or data frame. Description will be updated soon.
  • truemajoritypredicted values, using raw outputs of trees (not majority vote). This option make sense if one set 'nodesize' option greater than 1. Hence, agregation is participative (at the leaf level) and not representative (at the tree level).
  • allraw outputs of the model. Not useful, unless further computation is needed, for example in case of Post-processing.

See Also

See Also as postProcessingVotes, bCI

Examples

Run this code
## same as randomForest example
#  data(iris)
# set.seed(111)
# ind <- sample(2, nrow(iris), replace = TRUE, prob = c(0.8, 0.2))

# iris.ruf <- randomUniformForest(Species ~ ., data = iris[ind == 1,], OOB = FALSE, 
# importance = FALSE, threads = 1)
# iris.pred <- predict(iris.ruf, iris[ind == 2,])

# table(observed = iris[ind == 2, "Species"], predicted = iris.pred)

## get all votes : note that aliases of classes are used internally and, for intermediate
## results, are not converted to their true values
# iris.all.votes <- predict(iris.ruf, iris[ind == 2,], type = "votes")

## get class probabilities
# iris.class.prob <- predict(iris.ruf, iris[ind == 2,], type = "prob")
# iris.class.prob

Run the code above in your browser using DataLab