text.dt.madlib: Add labels onto the figure generated by plot.dt.madlib

Description Usage Arguments Author(s) References See Also Examples

View source: R/madlib-rpart.R

Description

This is a function which adds labels to the plot generated by plot.dt.madlib.

Usage

1
2
3
4
    ## 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, ...)

Arguments

x

The fitted tree from the result of madlib.rpart

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 minlength argument.

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 par).

Author(s)

Author: Predictive Analytics Team at Pivotal Inc.

Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io

References

[1] Documentation of decision tree in MADlib 1.6, https://madlib.apache.org/docs/latest/

See Also

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.

Examples

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

PivotalR documentation built on March 13, 2021, 1:06 a.m.