ensemble_weighted {modeltime.ensemble} | R Documentation |
Creates a Weighted Ensemble Model
Description
Makes an ensemble by applying loadings
to weight sub-model predictions
Usage
ensemble_weighted(object, loadings, scale_loadings = TRUE)
Arguments
object |
A Modeltime Table |
loadings |
A vector of weights corresponding to the loadings |
scale_loadings |
If TRUE, divides by the sum of the loadings to proportionally weight the submodels. |
Details
The input to an ensemble_weighted()
model is always a Modeltime Table,
which contains the models that you will ensemble.
Weighting Method
The weighted method uses uses loadings
by applying a
loading x model prediction for each submodel.
Value
A mdl_time_ensemble
object.
Examples
library(tidymodels)
library(modeltime)
library(modeltime.ensemble)
library(dplyr)
library(timetk)
# Make an ensemble from a Modeltime Table
ensemble_fit <- m750_models %>%
ensemble_weighted(
loadings = c(3, 3, 1),
scale_loadings = TRUE
)
ensemble_fit
# Forecast with the Ensemble
modeltime_table(
ensemble_fit
) %>%
modeltime_forecast(
new_data = testing(m750_splits),
actual_data = m750
) %>%
plot_modeltime_forecast(
.interactive = FALSE,
.conf_interval_show = FALSE
)
[Package modeltime.ensemble version 1.0.4 Index]