We first visualize the CART_Dummy
dataset and then look in the next subsection at how CART gets the patterns, which are believed to exist in the data.
Obtain the dataset
CART_Dummy
from theRSADBE
package by usingdata( CART_Dummy).
Convert the binary output Y as a factor variable, and attach the data frame with
CART_Dummy$Y <- as.factor(CART_Dummy$Y)
.attach(CART_Dummy)
In Figure 1: A complex classification dataset with partitions, the red squares refer to
0
and the green circles to1
.Initialize the graphics windows for the three samples by using
par(mfrow= c(1,2))
.Create a blank scatter plot:
plot(c(0,12),c(0,10),type="n",xlab="X1",ylab="X2").
Plot the green circles and red squares:
points(X1[Y==0],X2[Y==0],pch=15,col="red") points(X1[Y==1],X2[Y==1],pch=19,col="green") title(main="A Difficult Classification Problem")
Repeat the previous two steps to obtain the identical plot on the right side of the graphics window.
First, partition according to...