library("MASS") # for Boston Housing data
library("rpart")
model <-rpart(medv~., data=Boston, cp=0)
plot(model); text(model, cex=0.8)
printcp(model)
plotcp(model)
pmodel1 <- prune(model, cp=0.25)
pmodel1
cp <- model$cptable[which.min(
model$cptable[,"xerror"]),"CP"]
pmodel2 <- prune(model, cp=cp)
pmodel2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.