| Library: | plot |
| See also: | cartsplit dispcart2 tree grcart2 |
| Macro: | plotcart2 | |
| Description: | produces the cut graphic for a CART tree and allows the user interactively to change the tree parameters as well as the projection plane. |
| Usage: | plotcart2(x,tree{,xname}) | |
| Input: | ||
| x | n x p, X-variables used in cartsplit | |
| tree | list, result of cartsplit | |
| xname | textmatrix, names of the variables (optional) | |
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
plotcart2(xdat, tr)
shows the X1-X2-plane with all cuts in the tree tr
| Library: | plot |
| See also: | cartsplit dispcart2 tree grcart2 |