Learn R Programming

randomUniformForest (version 1.1.2)

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

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 makes sense if one set 'nodesize' option greater than 1. Hence, aggregation 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

postProcessingVotes, bCI, model.stats

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