Description Usage Arguments Value Author(s) References See Also Examples
This is a visualization function which plots the result of madlib.rpart
. This
function internally calls R's plot.rpart
function.
1 2 3 4 5 |
x |
The fitted tree from the result of |
uniform |
A boolean, if TRUE, uses uniform vertical spacing of the nodes. |
branch |
A double value, between 0 and 1, to control the shape of the branches from parent to child. |
compress |
A boolean, if FALSE, the leaf nodes will be at the horizontal plot coordinate of 1:nleaves. Use TRUE for a more compact arrangement. |
nspace |
A double value, indicating the amount of extra space between a node with children
and a leaf. default is |
margin |
A double value, indicating the amount of extra space to leave around the borders of the tree. |
minbranch |
A double value, specifying the minimum length for a branch. |
... |
Arguments to be passed to or from other methods. |
The coordinates of the nodes are returned as a list, with components x and y.
Author: Predictive Analytics Team at Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
[1] Documentation of decision tree in MADlib 1.6, https://madlib.apache.org/docs/latest/
madlib.rpart
is the wrapper for MADlib's tree_train function for decision trees.
text.dt.madlib
, print.dt.madlib
are other visualization functions.
madlib.lm
, madlib.glm
, madlib.rpart
,
madlib.summary
, madlib.arima
, madlib.elnet
are all MADlib wrapper functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## 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.rpart(rings < 10 ~ length + diameter + height + whole + shell,
data=x, parms = list(split='gini'), control = list(cp=0.005))
fit
plot(fit, uniform =TRUE)
text(fit)
db.disconnect(cid)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.