a guest Aug 10th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- attr(ptitanic$age,"class") <- NULL;
- #This is a function which draws the tree
- ptitanicTree = rpart(survived~., data = data,
- control = rpart.control(minsplit = 5, cp = 0),
- method = "class")
- ptitanicOptimal = prune(ptitanicTree,
- cp = ptitanicTree$cptable[which.min(ptitanicTree$cptable[,4]),1] )
- # I change the position switching column 5 and 6
- # Here i get an another tree : why ?
RAW Paste Data