text.dt.madlib {PivotalR} | R Documentation |
This is a function which adds labels to the plot generated by plot.dt.madlib
.
## S3 method for class 'dt.madlib' text(x, splits = TRUE, label, FUN = text, all = FALSE, pretty = NULL, digits = getOption("digits") - 3L, use.n = FALSE, fancy = FALSE, fwidth = 0.8, fheight = 0.8, bg = par("bg"), minlength = 1L, ...)
x |
The fitted tree from the result of |
splits |
A boolean, if TRUE, labels the splits with the criterion for the split. |
label |
This is currently ignored. |
FUN |
The name of a labeling function, e.g. text |
all |
A boolean, if TRUE, labels all the nodes, otherwise just the terminal nodes. |
pretty |
An alternative to the |
digits |
Number of significant digits to include in numeric labels. |
use.n |
A boolean, if TRUE, adds to label (\#events level1/ \#events level2/etc. for classification and n for regression) |
fancy |
A boolean, if TRUE, represents internal nodes by ellipses and leaves by rectangles. |
fwidth |
Controls the width of the ellipses and rectangles if fancy=TRUE. |
fheight |
Controls the height of the ellipses and rectangles if fancy=TRUE. |
bg |
The color used to paint the background if fancy=TRUE. |
minlength |
The length to use for factor labels. |
... |
Other graphical parameters to be supplied as input to this function (see |
Author: Predictive Analytics Team at Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
[1] Documentation of decision tree in MADlib 1.6, http://doc.madlib.net/latest/
madlib.rpart
is the wrapper for MADlib's tree_train function for decision trees.
plot.dt.madlib
, print.dt.madlib
are visualization functions
for a model fitted through madlib.rpart
predict.dt.madlib
is a wrapper for MADlib's predict function for
decision trees.
madlib.lm
, madlib.glm
,
madlib.summary
, madlib.arima
, madlib.elnet
are all MADlib wrapper functions.
## 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.rpart(rings < 10 ~ length + diameter + height + whole + shell, data=x, parms = list(split='gini'), control = list(cp=0.005)) plot(fit, uniform=TRUE) text(fit, use.n=TRUE, all=TRUE) db.disconnect(cid) ## End(Not run)