10.4 Plotting the Result of CART


19679 plotcarttree (carttree{, outval})
plots the CART tree
19682 dispcarttree (ctdisp, xn, yn, carttree{, outval})
plots the CART tree in an user given display ctdisp
$ \{$tree, treelabel$ \}$ = 19685 grcarttree (carttree{, outval})
generates two graphical objects which contain the plot of the CART tree and the labels in the CART tree
19688 plotcart2 (x, tree{, xname})
plots the cuts of CART in a two-dimensional projection of the dataset x
19691 dispcart2 (cartdisp, xn, yn, x, carttree, ix, iy, depth, ssr)
plots the cuts of CART in a twodimensional projection of the dataset x in an user given display cartdisp
cut = 19694 grcart2 (x, carttree, ix, iy, depth, ssr)
generates the cuts which contain a two-dimensional projection of the data x
For visualizing the results two methods are provided:
  1. plotting the tree via 19697 plotcarttree , 19700 dispcarttree or 19703 grcarttree
  2. 19706 plotcart2 , 19709 dispcart2 or 19712 grcart2 show how CART tesselates a two-dimensional projection of the data
As an output of 19715 cartsplit we receive the CART tree (carttree). The first method plots the CART tree. Depending on the value given in outval we get as labels at the nodes in the tree the splitting rules (default), the numbers of observations in a node ("nelem"), the mean value of the observations in a node ("mean") or the sum of squared residuals ("ssr") in a node.

To get an overview how CART tesselates the space we can plot the tesselations in two dimensional projections of the data. The quantlet 19718 plotcart2 allows the user to interactively change the projections. Also interactively we can choose if we want to see all cuts to a specified level (see depth) or all cuts where the sum of squared residuals (see ssr) is above a specified limit.

Note: if you view the cuts at the projection then be aware that cuts could appear in the tree which ar not visible. Thus the plot has to be interpreted with care! Additionally the plot can only be applied to projections of continuous variables.