| blackboost | R Documentation |
Gradient boosting for optimizing arbitrary loss functions where regression trees are utilized as base-learners.
blackboost(formula, data = list(),
weights = NULL, na.action = na.pass,
offset = NULL, family = Gaussian(),
control = boost_control(),
oobweights = NULL,
tree_controls = partykit::ctree_control(
teststat = "quad",
testtype = "Teststatistic",
mincriterion = 0,
minsplit = 10,
minbucket = 4,
maxdepth = 2,
saveinfo = FALSE),
...)
formula |
a symbolic description of the model to be fit. |
data |
a data frame containing the variables in the model. |
weights |
an optional vector of weights to be used in the fitting process. |
na.action |
a function which indicates what should happen when the data
contain |
offset |
a numeric vector to be used as offset (optional). |
family |
a |
control |
a list of parameters controlling the algorithm. For
more details see |
oobweights |
an additional vector of out-of-bag weights, which is
used for the out-of-bag risk (i.e., if |
tree_controls |
an object of class |
... |
additional arguments passed to |
This function implements the ‘classical’
gradient boosting \bibcitepmboost::nr:freund.schapire:1996,mboost::friedman2001
as reviewed by \bibcitetmboost::Buehlmann:2008:StatSci
utilizing unbiased regression trees \bibcitepmboost::Hothorn:2006:JCGS as base-learners.
Essentially, the same algorithm is implemented in package
gbm \bibcitetmboost::ridgew99. The
main difference is that arbitrary loss functions to be optimized
can be specified via the family argument to blackboost whereas
gbm uses hard-coded loss functions.
Moreover, the base-learners (conditional
inference trees, see ctree) are a little bit more flexible.
The regression fit is a black box prediction machine and thus hardly interpretable.
Partial dependency plots are not yet available; see example section for plotting of additive tree models.
An object of class mboost with print
and predict methods being available.
*
See mboost_fit for the generic boosting function,
glmboost for boosted linear models, and
gamboost for boosted additive models.
See baselearners for possible base-learners.
See cvrisk for cross-validated stopping iteration.
Furthermore see boost_control, Family and
methods.
### a simple two-dimensional example: cars data
cars.gb <- blackboost(dist ~ speed, data = cars,
control = boost_control(mstop = 50))
cars.gb
### plot fit
plot(dist ~ speed, data = cars)
lines(cars$speed, predict(cars.gb), col = "red")
### set up and plot additive tree model
if (require("partykit")) {
ctrl <- ctree_control(maxdepth = 3)
viris <- subset(iris, Species != "setosa")
viris$Species <- viris$Species[, drop = TRUE]
imod <- mboost(Species ~ btree(Sepal.Length, tree_controls = ctrl) +
btree(Sepal.Width, tree_controls = ctrl) +
btree(Petal.Length, tree_controls = ctrl) +
btree(Petal.Width, tree_controls = ctrl),
data = viris, family = Binomial())[500]
layout(matrix(1:4, ncol = 2))
plot(imod)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.