distributed predict method for applying a random forest objects on a darray or a dframe

Share:

Description

This function can be used to apply a model of type drandomForest or randomForest to a new data for prediction.

Usage

1
2
  ## S3 method for class 'drandomForest'
predict(object, newdata, trace=FALSE, ...)

Arguments

object

an object of class randomForest, as that created by the function randomForest or drandomForest.

newdata

a darray, a dframe, a data.frame, or a matrix that contains new data. darray is highly recommended to dframe when there is no categorial data

trace

when this argument is true, intermediate steps of the progress are displayed.

...

additional arguments to be passed to predict.randomForest

Value

It returns predicted classes in a distributed or non-distributed objects depending on the type of the input. When the newdata is of type darray, the type of returned value will be also darray unless the output is categorical data. When the output is a dframe when the newdata is of type dframe.

Author(s)

Vishrut Gupta, Arash Fard, Winston Li, Matthew Saltz

References

Breiman, L. (2001), Random Forests, Machine Learning 45(1), 5-32.

See Also

drandomForest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 ## Not run: 
# example for darray
library(ddR.randomForest)

nExecutor <- 2
iris.rf <- drandomForest(Species ~ ., iris,nExecutor = nExecutor)
iris.predictions <- predict(iris.rf,iris)
    

## End(Not run)