Description Usage Arguments Value Author(s) References See Also Examples
View source: R/madlib-randomForest.R
This is actually a wrapper for MADlib's predict function of
random forests. It accepts the result of madlib.randomForest
,
which is a representation of a random forest model, and computes the
predictions for new data sets.
1 2 3 |
object |
A |
newdata |
A |
type |
A string, default is "response". For regessions, this will generate the fitting values. For classification, this will generate the predicted class values. There is an extra option "prob" for classification models, which computes the probabilities of each class. |
... |
Other arguments. Not implemented yet. |
A db.obj
object, which wraps a table that contains the predicted
values and also a valid ID column. For type='response'
, the predicted column
has the fitted value (regression model) or the predicted classes (classification model).
For type='prob'
, there are one column for each class, which contains the probabilities
for that class.
Author: Predictive Analytics Team at Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
[1] Documentation of random forests in MADlib 1.7, https://madlib.apache.org/docs/latest/
madlib.lm
, madlib.glm
, madlib.randomForest
,
madlib.rpart
, madlib.summary
, madlib.arima
,
madlib.elnet
are all MADlib wrapper functions.
predict.lm.madlib
, predict.logregr.madlib
,
predict.elnet.madlib
, predict.arima.css.madlib
,
predict.dt.madlib
, predict.rf.madlib
are all predict functions related to MADlib wrapper functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)
x <- as.db.data.frame(abalone, conn.id = cid, verbose = FALSE)
key(x) <- "id"
fit <- madlib.randomForest(rings < 10 ~ length + diameter + height + whole + shell,
data=x)
predict(fit, x, 'r')
db.disconnect(cid)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.