Uses a Validation Set to select the best trees within the list of pruned trees.
TreePruning(Fit, VSet)
A BEST object
A Validation Set (Can also be used in CV loop)
The shallower trees among trees wiht Highest accuracy. This replaces the first element in the BEST object list.
# NOT RUN { nv <- 50 ValData <- BESTree::Data[(1000+1):nv,] Fit <- BESTree::Fit Fit[[1]] <- BESTree::TreePruning(Fit,ValData) # }
Run the code above in your browser using DataLab