predict {tsensembler} | R Documentation |
Predicting new observations using an ensemble
Description
Initially, the predictions of the base models are collected. Then, the predictions of the loss to be incurred by the base models E_hat (estimated by their associate meta models) are computed. The weights of the base models are then estimated according to E_hat and the committee of top models. The committee is built according to the lambda and omega parameters. Finally, the predictions are combined according to the weights and the committee setup.
Usage
## S4 method for signature 'ADE'
predict(object, newdata)
## S4 method for signature 'DETS'
predict(object, newdata)
## S4 method for signature 'base_ensemble'
predict(object, newdata)
Arguments
object |
an object of class |
newdata |
new data to predict |
Examples
###### Predicting with an ADE ensemble
specs <- model_specs(
learner = c("bm_glm", "bm_mars"),
learner_pars = NULL
)
data("water_consumption")
dataset <- embed_timeseries(water_consumption, 5)
train <- dataset[1:1000, ]
test <- dataset[1001:1500, ]
model <- ADE(target ~., train, specs)
preds <- predict(model, test)
## Not run:
###### Predicting with a DETS ensemble
specs <- model_specs(
learner = c("bm_svr", "bm_glm", "bm_mars"),
learner_pars = NULL
)
data("water_consumption")
dataset <- embed_timeseries(water_consumption, 5)
train <- dataset[1:700, ]
test <- dataset[701:1000, ]
model <- DETS(target ~., train, specs, lambda = 50, omega = .2)
preds <- predict(model, test)
## End(Not run)
## Not run:
###### Predicting with a base ensemble
model <- ADE(target ~., train, specs)
basepreds <- predict(model@base_ensemble, test)
## End(Not run)
[Package tsensembler version 0.1.0 Index]