dplot3_cart | R Documentation |
rpart
decision treesPlot rpart
decision trees using data.tree::plot.Node
dplot3_cart(
object,
col.positive = "#F48024DD",
col.negative = "#18A3ACDD",
col.lo = "#80ffff",
col.mid = "gray20",
col.hi = "#F4A0FF",
node.col = "#666666",
node.shape = "none",
node.labels = TRUE,
node.cond = TRUE,
node.prob = TRUE,
node.estimate = NULL,
node.n = TRUE,
edge.col = "#999999",
edge.width = 2,
edge.labels = FALSE,
arrowhead = "vee",
layout = "dot",
drop.leaves = FALSE,
rankdir = "TB",
splines = "polyline",
fontname = "helvetica",
bg.color = "white",
overlap = "false",
prune = FALSE,
rpart.cp = NULL,
verbose = TRUE
)
object |
Either |
col.positive |
Color for outcome positive. |
col.negative |
Color for negative outcome. |
col.lo |
Low color for estimated outcome |
col.mid |
Middle color for estimated outcome |
col.hi |
High color for estimated outcome |
node.col |
Color for non-terminal leaves. |
node.shape |
Shape of node. Default = "none" |
node.labels |
Logical: If TRUE, print the node labels. |
node.cond |
Logical: If TRUE, print the splitting condition inside each node. |
node.prob |
Logical: If TRUE, print the probability estimate for the first class of the outcome inside each node. |
node.estimate |
Logical: If TRUE, print the estimated outcome level inside each node. |
node.n |
Logical: If TRUE, print the number of cases (from training data) that matched this condition |
edge.col |
Color for edges. |
edge.width |
Width of edges. |
edge.labels |
Logical: If TRUE, print the splitting condition on the edge. |
arrowhead |
Character: Arrowhead shape. |
layout |
Character: Passed to |
drop.leaves |
Logical: If TRUE, position leaves at the bottom of the plot. |
rankdir |
Character: Passed to |
splines |
Character: Passed to |
fontname |
Character: Passed to |
bg.color |
Background color. |
overlap |
Character: Passed to |
prune |
Logical: If TRUE, prune tree using |
rpart.cp |
Numeric: Complexity parameter for pruning. If NULL, no pruning is performed. |
verbose |
Logical: If TRUE, print messages. |
If you want to show split conditions as edge labels (edge.labels = TRUE
),
it is recommened to set rankdir = "LR"
and node.cond = FALSE
.
Edge labels in graphviz are shown to the right of
the edge when rankdir = "TB"
and above when rankdir = "LR"
.
E.D. Gennatas
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.