predict.betaboost {betaboost} | R Documentation |
Make predictions for betaboost models
## S3 method for class 'betaboost' predict(object, newdata = NULL, type = c("link", "response", "class"), which = NULL, aggregate = c("sum", "cumsum", "none"), ...)
object |
a fitted model object of class |
newdata |
optional; A data frame in which to look for variables with which to predict or with which to plot the marginal prediction intervals. |
type |
the type of prediction required. The default is on the scale
of the predictors; the alternative |
which |
a subset of base-learners to take into account when computing
predictions or coefficients. If |
aggregate |
a character specifying how to aggregate predictions
or coefficients of single base-learners. The default
returns the prediction or coefficient for the final number of
boosting iterations. |
... |
additional arguments. Currently, only |
The predict
function can be used for predictions for the
distribution parameters depending on new observations.
Benjamin Hofner <benjamin.hofner@pei.de>
predict.mboost
and predict.mboostLSS
## load data data(QoLdata) ## define test data test <- QoLdata[1:10,] train <- QoLdata[11:nrow(QoLdata),] ## fit model on training data b1 <- betaboost(formula = QoL ~ arm + pain, data = train, iterations = 500) ## predict on test data predict(b1, newdata = test, type = "response") ## nuissance parameter phi nuisance(b1) ## the same, but modelling also phi b2 <- betaboost(formula = QoL ~ arm + pain, data = train, iterations = 1000, phi.formula = QoL ~ arm + pain) ## now also estimates for phi predict(b2, newdata = test, type = "response")