Library: | xclust |
See also: | cartsplit dispcarttree grcarttree grcart2 |
Macro: | dispcarttree | |
Description: | Plots the regression tree of CART in a display |
Usage: | {g, gp} = grcarttree(ts,stri) | |
Input: | ||
cs | list of vectors: data structure which represents a binary tree and is produced by cartsplit procedure, contains vectors .. cs.val, cs.vec, cs.mean, cs.ssr, cs.nelem. See cartsplit for the description of cs. | |
stri | string: optional argument, either missing, "nelem", "ssr" or "mean". | |
Output: | ||
g | CART tree | |
gp | text labels for CART tree |
; loads the library xclust library ("xclust") ; generate an artifcal dataset 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) ; run CART on our data cs=cartsplit(x,y,#(0,1)) ; plot CART tree d = createdisplay(1,1) {g, gp} = grcarttree (cs) show (d, 1, 1, g, gp)
shows the tree with the splitting rules
Library: | xclust |
See also: | cartsplit dispcarttree grcarttree grcart2 |