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:
install.packages("modeltime.ensemble")
Or, install the development version:
remotes::install_github("business-science/modeltime.ensemble")
Load the following libraries.
library(tidymodels) library(modeltime) library(modeltime.ensemble) library(dplyr) library(timetk)Step 1 - Create a Modeltime Table
Create a Modeltime Table using the modeltime
package.
m750_models #> # Modeltime Table #> # A tibble: 3 × 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> GLMNETStep 2 - Make a Modeltime Ensemble
Then turn that Modeltime Table into a Modeltime Ensemble.
ensemble_fit <- m750_models %>% ensemble_average(type = "mean") ensemble_fit #> ── Modeltime Ensemble ─────────────────────────────────────────── #> Ensemble of 3 Models (MEAN) #> #> # Modeltime Table #> # A tibble: 3 × 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
To forecast, just follow the Modeltime Workflow.
# Calibration calibration_tbl <- modeltime_table( ensemble_fit ) %>% modeltime_calibrate(testing(m750_splits), quiet = FALSE) # Forecast vs Test Set calibration_tbl %>% modeltime_forecast( new_data = testing(m750_splits), actual_data = m750 ) %>% plot_modeltime_forecast(.interactive = FALSE)Meet the modeltime ecosystem
Learn a growing ecosystem of forecasting packages
The modeltime ecosystem is growing
Modeltime is part of a growing ecosystem of Modeltime forecasting packages.
Take the High-Performance Forecasting CourseBecome the forecasting expert for your organization
High-Performance Time Series Course
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 by improving accuracy and scalability. Imagine what will happen to your career if you can provide your organization a “High-Performance Time Series Forecasting System” (HPTSF System).
How to Learn High-Performance Time Series ForecastingI teach how to build a HPTFS System in my High-Performance Time Series Forecasting Course. You will learn:
Modeltime
- 30+ Models (Prophet, ARIMA, XGBoost, Random Forest, & many more)GluonTS
(Competition Winners)Become the Time Series Expert for your organization.
Take the High-Performance Time Series Forecasting Course
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4