Estimates the optimal number of boosting iterations for a gbm object
and optionally plots various performance measures
Arguments
- object
A
gbm.objectcreated from an initial call togbm.- plot.it
An indicator of whether or not to plot the performance measures. Setting
plot.it = TRUEcreates two plots. The first plot plotsobject$train.error(in black) andobject$valid.error(in red) versus the iteration number. The scale of the error measurement, shown on the left vertical axis, depends on thedistributionargument used in the initial call togbm.- oobag.curve
Indicates whether to plot the out-of-bag performance measures in a second plot.
- overlay
If TRUE and oobag.curve=TRUE then a right y-axis is added to the training and test error plot and the estimated cumulative improvement in the loss function is plotted versus the iteration number.
- method
Indicate the method used to estimate the optimal number of boosting iterations.
method = "OOB"computes the out-of-bag estimate andmethod = "test"uses the test (or validation) dataset to compute an out-of-sample estimate.method = "cv"extracts the optimal number of iterations using cross-validation ifgbmwas called withcv.folds> 1.
Value
gbm.perf Returns the estimated optimal number of iterations.
The method of computation depends on the method argument.
Author
Greg Ridgeway gregridgeway@gmail.com