Prunes all trees in the forest and re-calculates the out-of-bag predictions and performance measures. The training data is needed to calculate the out-of-bag statistics. Note that the forest is pruned in place. If you intend to keep the original forest, make a copy of it before pruning.
# S3 method for class 'SDForest'
prune(object, cp, X = NULL, Y = NULL, Q = NULL, pred = TRUE, ...)
an SDForest object
Complexity parameter, the higher the value the more nodes are pruned.
The training data, if NULL the data from the forest object is used.
The training response variable, if NULL the data from the forest object is used.
The transformation function, if NULL the data from the forest object is used.
If TRUE the predictions are calculated, if FALSE only the out-of-bag statistics are calculated. This can set to FALSE to save computation time if only the out-of-bag statistics are needed.
Further arguments passed to or from other methods.
A pruned SDForest object