User Tools

Site Tools


cs:cart:solution_ex1
vltava.spe <- read.delim ('http://www.davidzeleny.net/anadat-r/data-download/vltava-spe.txt', row.names = 1)
vltava.env <- read.delim ('http://www.davidzeleny.net/anadat-r/data-download/vltava-env.txt')
 
 
tree.1 <- rpart (as.factor (vltava.env$GROUP) ~ ., data = sqrt (vltava.spe))
draw.tree (tree.1, nodeinfo = T)
 
plotcp (tree.1)
 
par (mfrow = c(1,2))
rsq.rpart (tree.1)
 
tree.2 <- prune (tree.1, cp = 0.078)
draw.tree (tree.2, nodeinfo = T)

cs/cart/solution_ex1.txt · Last modified: 2017/10/11 20:36 (external edit)