Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.extraTrees

Function for making predictions from trained ExtraTree object.


Description

This function makes predictions for regression/classification using the given trained ExtraTree object and provided input matrix (newdata).

Usage

## S3 method for class 'extraTrees'
predict(object, newdata, quantile=NULL, allValues=F, probability=F, newtasks=NULL, ...)

Arguments

object

extraTree (S3) object, created by extraTrees().

newdata

a new numberic input data matrix, for each row a prediction is made.

quantile

the quantile value between 0.0 and 1.0 for quantile regression, or NULL (default) for standard predictions.

allValues

whether or not to return outputs of all trees (default FALSE).

probability

whether to return a matrix of class (factor) probabilities, default FALSE. Can only be used in the case of classification. Calculated as the proportion of trees voting for particular class.

newtasks

list of tasks, for each input in newdata (default NULL). Must be NULL if no multi-task learning was used at training.

...

not used currently.

Value

The vector of predictions from the ExtraTree et. The length of the vector is equal to the the number of rows in newdata.

Author(s)

Jaak Simm

Examples

## Regression with ExtraTrees:
  n <- 1000  ## number of samples
  p <- 5     ## number of dimensions
  x <- matrix(runif(n*p), n, p)
  y <- (x[,1]>0.5) + 0.8*(x[,2]>0.6) + 0.5*(x[,3]>0.4) + 0.1*runif(nrow(x))
  et <- extraTrees(x, y, nodesize=3, mtry=p, numRandomCuts=2)
  yhat <- predict(et, x)

extraTrees

Extremely Randomized Trees (ExtraTrees) Method for Classification and Regression

v1.0.5
Apache License 2.0
Authors
Jaak Simm, Ildefons Magrans de Abril
Initial release
2014-12-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.