rpart
object
by recursively snipping
off the least important splits, based on the
complexity parameter (cp
).prune.rpart(tree, cp, ...)
rpart
. This is assumed to be the result
of some function that produces an object with the same named
components as that returned by the rpart
function.rpart
object will be trimmed.rpart
object that is trimmed to the value cp
.rpart
data(car.test.frame)
z.auto <- rpart(Mileage ~ Weight, car.test.frame)
zp <- prune.rpart(z.auto, cp=0.1)
plot(zp) #plot smaller rpart object
Run the code above in your browser using DataLab