getTree.rf.madlib: MADlib wrapper function for Random Forest

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/madlib-randomForest.R

Description

This function is a wrapper of MADlib's random forest model get_tree function. The model built using madlib.randomForest is passed as input to this function.

Usage

1
getTree.rf.madlib(object, k=1, ...) 

Arguments

object

A random forest model object built using madlib.randomForest.

k

Id of the tree to be retrieved. Can range between 1 and maximum number of trees in the forest. default is 1.

...

Arguments to be passed to or from other methods.

Value

A data frame object similar to R's getTree result.

Author(s)

Author: Predictive Analytics Team at Pivotal Inc.

Maintainer: Frank McQuillan, Pivotal Inc. [email protected]

References

[1] Documentation of random forest in MADlib 1.7, http://doc.madlib.net/latest/

See Also

madlib.randomForest function to train a random forest model.

print.rf.madlib function to print summary of a model fitted through madlib.randomForest

predict.rf.madlib is a wrapper for MADlib's predict function for random forests.

madlib.lm, madlib.glm, madlib.summary, madlib.arima, madlib.elnet, madlib.rpart are all MADlib wrapper functions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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)
lk(x, 10)

## decision tree using abalone data, using default values of minsplit, 
## maxdepth etc.
key(x) <- "id"
fit <- madlib.randomForest(rings < 10 ~ length + diameter + height + whole + shell, 
       data=x)
fit
getTree.rf.madlib(fit, k=2)


db.disconnect(cid)

## End(Not run)

PivotalR documentation built on May 30, 2017, 8:18 a.m.