Learn R Programming

tsensembler (version 0.0.5)

forecast: Forecasting using an ensemble predictive model

Description

Generic function for forecasting future values of a time series from an ADE-class model or a DETS-class model.

Usage

forecast(object, h)

# S4 method for ADE forecast(object, h)

# S4 method for DETS forecast(object, h)

Arguments

object

predictive model object. A ADE-class or a DETS-class ensemble object;

h

steps to forecast

See Also

predict for the predict method; update_weights for updating the weights of a model after forecasting; update_base_models for updating the base models of an ensemble.

Examples

Run this code
# NOT RUN {
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:500, ]

model <- DETS(target ~., train, specs)
model2 <- ADE(target ~., train, specs, lambda = 30)

next_vals_dets <- forecast(model, h = 2)
next_vals_ade <- forecast(model2, h = 2)


# }

Run the code above in your browser using DataLab