You will need to give more detail of exactly what you mean by "prune using a validation set". THe prune.rpart function will prune at any value you want, what I suspect you are looking for is to compute the error of each possible tree, using a validation data set, then find the best one, and then prune there.

How do you define "best"?

Terry Therneau


On 02/26/2017 05:00 AM, r-help-requ...@r-project.org wrote:
I'd like to use a different data ( validation) set for pruning my
classification tree. Unfortunately there aren't arguments to get this in
prune.rpart().

Any suggestions?

Thanks!

Alfredo


______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to