-
Notifications
You must be signed in to change notification settings - Fork 17
/
README.Rmd
171 lines (115 loc) · 6.19 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
message = F,
warning = F,
paged.print = FALSE,
fig.path = "man/figures/README-",
# out.width = "100%"
fig.align = 'center'
)
```
# modeltime.ensemble <a href="https://business-science.github.io/modeltime.ensemble/"><img src="man/figures/logo.png" align="right" height="138" alt="modeltime.ensemble website" /></a>
<!-- badges: start -->
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/modeltime.ensemble)](https://cran.r-project.org/package=modeltime.ensemble)
![](http://cranlogs.r-pkg.org/badges/modeltime.ensemble?color=brightgreen)
![](http://cranlogs.r-pkg.org/badges/grand-total/modeltime.ensemble?color=brightgreen)
[![R-CMD-check](https://github.com/business-science/modeltime.ensemble/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/business-science/modeltime.ensemble/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/business-science/modeltime.ensemble/branch/master/graph/badge.svg)](https://app.codecov.io/gh/business-science/modeltime.ensemble?branch=master)
<!-- badges: end -->
> Ensemble Algorithms for Time Series Forecasting with Modeltime
A `modeltime` extension that implements ___ensemble forecasting methods___ including model averaging, weighted averaging, and stacking.
```{r, echo=F, out.width='100%', fig.align='center'}
knitr::include_graphics("vignettes/stacking.jpg")
```
## Installation
Install the CRAN version:
``` r
install.packages("modeltime.ensemble")
```
Or, install the development version:
``` r
remotes::install_github("business-science/modeltime.ensemble")
```
## Getting Started
1. [Getting Started with Modeltime](https://business-science.github.io/modeltime/articles/getting-started-with-modeltime.html): Learn the basics of forecasting with Modeltime.
2. [Getting Started with Modeltime Ensemble](https://business-science.github.io/modeltime.ensemble/articles/getting-started-with-modeltime-ensemble.html): Learn the basics of forecasting with Modeltime ensemble models.
## Make Your First Ensemble in Minutes
Load the following libraries.
```{r}
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.
```{r}
m750_models
```
#### Step 2 - Make a Modeltime Ensemble
Then turn that Modeltime Table into a ___Modeltime Ensemble.___
```{r}
ensemble_fit <- m750_models %>%
ensemble_average(type = "mean")
ensemble_fit
```
#### Step 3 - Forecast!
To forecast, just follow the [Modeltime Workflow](https://business-science.github.io/modeltime/articles/getting-started-with-modeltime.html).
```{r}
# 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
```{r, echo=F, out.width='100%', fig.align='center', fig.cap="The modeltime ecosystem is growing"}
knitr::include_graphics("man/figures/modeltime_ecosystem.jpg")
```
Modeltime is part of a __growing ecosystem__ of Modeltime forecasting packages.
- [Modeltime (Machine Learning)](https://business-science.github.io/modeltime/)
- [Modeltime H2O (AutoML)](https://business-science.github.io/modeltime.h2o/)
- [Modeltime GluonTS (Deep Learning)](https://business-science.github.io/modeltime.gluonts/)
- [Modeltime Ensemble (Blending Forecasts)](https://business-science.github.io/modeltime.ensemble/)
- [Modeltime Resample (Backtesting)](https://business-science.github.io/modeltime.resample/)
- [Timetk (Feature Engineering, Data Wrangling, Time Series Visualization)](https://business-science.github.io/timetk/)
## Take the High-Performance Forecasting Course
> Become the forecasting expert for your organization
<a href="https://university.business-science.io/p/ds4b-203-r-high-performance-time-series-forecasting/" target="_blank"><img src="https://www.filepicker.io/api/file/bKyqVAi5Qi64sS05QYLk" alt="High-Performance Time Series Forecasting Course" width="100%" style="box-shadow: 0 0 5px 2px rgba(0, 0, 0, .5);"/></a>
[_High-Performance Time Series Course_](https://university.business-science.io/p/ds4b-203-r-high-performance-time-series-forecasting/)
### Time Series is Changing
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 Forecasting
I teach how to build a HPTFS System in my [__High-Performance Time Series Forecasting Course__](https://university.business-science.io/p/ds4b-203-r-high-performance-time-series-forecasting). You will learn:
- __Time Series Machine Learning__ (cutting-edge) with `Modeltime` - 30+ Models (Prophet, ARIMA, XGBoost, Random Forest, & many more)
- __Deep Learning__ with `GluonTS` (Competition Winners)
- __Time Series Preprocessing__, Noise Reduction, & Anomaly Detection
- __Feature engineering__ using lagged variables & external regressors
- __Hyperparameter Tuning__
- __Time series cross-validation__
- __Ensembling__ Multiple Machine Learning & Univariate Modeling Techniques (Competition Winner)
- __Scalable Forecasting__ - Forecast 1000+ time series in parallel
- and more.
<p class="text-center" style="font-size:24px;">
Become the Time Series Expert for your organization.
</p>
<br>
<p class="text-center" style="font-size:30px;">
<a href="https://university.business-science.io/p/ds4b-203-r-high-performance-time-series-forecasting">Take the High-Performance Time Series Forecasting Course</a>
</p>