TreePruning {BESTree} | R Documentation |
Uses a Validation Set to select the best trees within the list of pruned trees.
TreePruning(Fit, VSet)
Fit |
A BEST object |
VSet |
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.
nv <- 50
ValData <- BESTree::Data[(1000+1):nv,]
Fit <- BESTree::Fit
Fit[[1]] <- BESTree::TreePruning(Fit,ValData)