Calculates a gradient boosting (gbm) object in which model complexity is determined using a training set with predictions made to a withheld set. An initial set of trees is fitted, and then trees are progressively added testing performance along the way, using gbm.perf until the optimal number of trees is identified.
As any structured ordering of the data should be avoided, a copy of the data set is BY DEFAULT randomly reordered each time the function is run.
gbm.holdout(data, gbm.x, gbm.y, learning.rate = 0.001, tree.complexity = 1,
family = "bernoulli", n.trees = 200, add.trees = n.trees, max.trees = 20000,
verbose = TRUE, train.fraction = 0.8, permute = TRUE, prev.stratify = TRUE,
var.monotone = rep(0, length(gbm.x)), site.weights = rep(1, nrow(data)),
refit = TRUE, keep.data = TRUE)
A gbm object
data.frame
indices of the predictors in the input dataframe
index of the response in the input dataframe
typically varied between 0.1 and 0.001
sometimes called interaction depth
"bernoulli","poisson", etc. as for gbm
initial number of trees
number of trees to add at each increment
maximum number of trees to fit
controls degree of screen reporting
proportion of data to use for training
reorder data to start with
stratify selection for presence/absence data
allows constraining of response to monotone
set equal to 1 by default
refit the model with the full data but id'd no of trees
keep copy of the data
John R. Leathwick and Jane Elith
Elith, J., J.R. Leathwick and T. Hastie, 2009. A working guide to boosted regression trees. Journal of Animal Ecology 77: 802-81