The following code will
generate a Decision Tree. You need to run the code and explain the
tree. After you get the Tree. You need to explain how does it draw
like that.
install.packages("rpart.plot") # install package
rpart.plot
##########################################
# section 7.1.1 Overview of a Decision Tree
##########################################
library("rpart")
library("rpart.plot")
# Read the data
setwd("c:/data/")
banktrain <-
read.table("bank-sample-test.csv",header=TRUE,sep=",")
## drop a few columns to simplify the
tree
drops<-c("age", "balance", "day", "campaign", "pdays",
"previous", "month")
banktrain <- banktrain [,!(names(banktrain) %in%
drops)]...