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: graphic
See also: cartsplit dispcart2 tree

Macro: grcart2
Description: produces the cut graphic for a CART tree.

Reference(s):

Link:
Usage: line = grcart2(x,tree,ix,iy,mindepth,minssr)
Input:
x nxp, X-variables used in cartsplit
tree list, result of cartsplit
ix scalar, which variable is taken for X
iy scalar, which variable is taken for Y
mindepth scalar, till which depth the tree should be shown
minssr scalar, shows all cuts which produce a SSR larger than minssr
Output:
line list, a graphical object that contains the cuts

Note:

Example:
randomize(1)
n=100
; Generate some simulated data
xdat=uniform(n,2)
ydat=120.*matrix(n,1)-(xdat[,2]<=0.5).*120-(xdat[,2]>0.5).*(xdat[,1]<=0.5).*20
ydat=ydat+normal(n)
; call CART
type=#(1,1)
opt=cartsplitopt("minsize",1,"mindev",0,"mincut",5)
tr=cartsplit(xdat,ydat,type,opt)
; shows cuts
d=createdisplay(1,1)
show(d, 1,1, xdat, grcart2(xdat, tr, 1, 2, 3, 0))
Result:
shows the data and the cuts till depth 3

Library: graphic
See also: cartsplit dispcart2 tree

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

Author: 2000-03-17, Sigbert Klinke
(C) MD*TECH Method and Data Technologies, 17.8.2000