predict.bagger | R Documentation |
The predict()
function computes predictions from each of the
models in the ensembles and returns a single aggregated value
for each sample in new_data
.
## S3 method for class 'bagger'
predict(object, new_data, type = NULL, ...)
object |
An object generated by |
new_data |
A data frame of predictors. If a recipe or formula were originally used, the original data should be passed here instead of a preprocessed version. |
type |
A single character value for the type of
predictions. For regression models, |
... |
Not currently used. |
data(airquality)
set.seed(7687)
cart_bag <- bagger(Ozone ~ ., data = airquality, base_model = "CART", times = 5)
predict(cart_bag, new_data = airquality[, -1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.