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.
Usage
# S3 method for SDForest
prune(object, cp, X = NULL, Y = NULL, Q = NULL, pred = TRUE, ...)
Value
A pruned SDForest object
Arguments
object
an SDForest object
cp
Complexity parameter, the higher the value the more nodes are pruned.
X
The training data, if NULL the data from the forest object is used.
Y
The training response variable, if NULL the data from the forest object is used.
Q
The transformation function, if NULL the data from the forest object is used.
pred
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.