Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: xclust
See also: cartsplitclass cartsplitregr cartpredict cartdrawpdfclass cartdrawpdfregr

Quantlet: grcarttree
Description: generates the graphical objects for the regression/classification trees.

Reference(s):

Link:
Usage: {g, gp} = grcarttree(tr,string)
Input:
tr list of vectors, data structure representing a binary tree, output from cartsplitregr or cartsplitclass. See cartsplitclass or cartsplitregr for detailed description.
string string, optional, either "NumberOfPoints", "Impurity" or "Class", default: see notes below
Output:
g composed graphical object, represents the CART tree
gp composed graphical object, represents the text labels for CART tree

Note:

Example:
; loads the library xclust
library("xclust")
; generates an artifcal data set
x1=#(0,0,0,0,1,1,1,1,1,2)
x2=#(0,0,0,0,0,0,0,1,1,1)
x=x1~x2
y=#(0,0,0,0,100,100,100,120,120,120)
; runs CART on our data
tr=cartsplitclass(x,y,0,1)
; plots CART tree
d = createdisplay(1,1)
{g, gp} = grcarttree(tr)
show(d, 1, 1, g, gp)

Result:
shows the tree with the splitting rules



Author: R. Timofeev, A. Andriyashin 20050115 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006