Travis build status Codecov test coverage CRAN_Status_Badge

Ensemble Algorithms for Time Series Forecasting with Modeltime

A modeltime extension that implements ensemble forecasting methods including model averaging, weighted averaging, and stacking.


Install the CRAN version:


Or, install the development version:


Getting Started

  1. Getting Started with Modeltime: Learn the basics of forecasting with Modeltime.
  2. Getting Started with Modeltime Ensemble: Learn the basics of forecasting with Modeltime ensemble models.

Make Your First Ensemble in Minutes

Load the following libraries.


Step 1 - Create a Modeltime Table

Create a Modeltime Table using the modeltime package.

#> # Modeltime Table
#> # A tibble: 3 x 3
#>   .model_id .model     .model_desc            
#>       <int> <list>     <chr>                  
#> 1         1 <workflow> ARIMA(0,1,1)(0,1,1)[12]
#> 2         2 <workflow> PROPHET                
#> 3         3 <workflow> GLMNET

Step 2 - Make a Modeltime Ensemble

Then turn that Modeltime Table into a Modeltime Ensemble.

ensemble_fit <- m750_models %>%
    ensemble_average(type = "mean")

#> ── Modeltime Ensemble ───────────────────────────────────────────
#> Ensemble of 3 Models (MEAN)
#> # Modeltime Table
#> # A tibble: 3 x 3
#>   .model_id .model     .model_desc            
#>       <int> <list>     <chr>                  
#> 1         1 <workflow> ARIMA(0,1,1)(0,1,1)[12]
#> 2         2 <workflow> PROPHET                
#> 3         3 <workflow> GLMNET

Step 3 - Forecast!

To forecast, just follow the Modeltime Workflow.

# Calibration
calibration_tbl <- modeltime_table(
) %>%
    modeltime_calibrate(testing(m750_splits), quiet = FALSE)

# Forecast vs Test Set
calibration_tbl %>%
        new_data    = testing(m750_splits),
        actual_data = m750
    ) %>%
    plot_modeltime_forecast(.interactive = FALSE)

Learning More


My Talk on High-Performance Time Series Forecasting

Time series is changing. Businesses now need 10,000+ time series forecasts every day. This is what I call a High-Performance Time Series Forecasting System (HPTSF) - Accurate, Robust, and Scalable Forecasting.

High-Performance Forecasting Systems will save companies MILLIONS of dollars. Imagine what will happen to your career if you can provide your organization a “High-Performance Time Series Forecasting System” (HPTSF System).

I teach how to build a HPTFS System in my High-Performance Time Series Forecasting Course. If interested in learning Scalable High-Performance Forecasting Strategies then take my course. You will learn:

Unlock the High-Performance Time Series Forecasting Course