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