plot_dt {lazy.tree}R Documentation

Plot Decision Tree

Description

Plot Decision Tree

Usage

plot_dt(
  obj,
  title = "Decision Tree",
  type = 1,
  xname = NULL,
  col_leaf = NULL,
  pch = 1,
  lwd = 4,
  cex = 0.7
)

Arguments

obj

The output of DecTree or list of nodes.

title

The title string

type

= 2 for numeric criterion

xname

Vector consisting of the names of the regressors.
This is to provide the regressor names when obj is just a list of nodes.

col_leaf

Color names for the leaf nodes, or NULL

pch

point type of legend

lwd

point size of legend

cex

character size of legend

Details

This function requires igraph package.

Value

A dataframe consisting of

nodename = node name
nodenum = leaf node name
varnum = variable name
Col = color of the nodes#'

Examples

## Not run: 
library(igraph)
Xc <- as.data.frame(cbind(square$c1,square$c2))
res1 <- DecTree( square$Class4, Xc, maxdepth=3, print=1 )
plot_dt( res1, title="square"
       , col_leaf=c("red","darkgreen","orange","lightblue") )
plot_dt( res1$node, title="square", xname=res1$xname )

## End(Not run)



[Package lazy.tree version 0.1.6 ]