business-science / modeltime.gluonts

GluonTS Deep Learning with Modeltime
https://business-science.github.io/modeltime.gluonts/
Other
39 stars 9 forks source link

New Model: DeepState #31

Closed mdancho84 closed 3 years ago

mdancho84 commented 3 years ago

Implement the DeepState algorithm.

mdancho84 commented 3 years ago

The deep_state() function implements the GluonTS DeepStateEstimator().

Minimal Example

library(modeltime.gluonts)
library(tidymodels)
library(tidyverse)
library(timetk)

splits <- walmart_sales_weekly %>%
    time_series_split(
        assess     = 26,
        cumulative = TRUE
    )

model_fit_deepstate <- deep_state(
    id                    = "id",
    freq                  = "W",
    prediction_length     = 26,
    lookback_length       = 52*2,
    add_trend             = FALSE,
    epochs                = 2,
    scale                 = TRUE
) %>%
    set_engine("gluonts_deepstate") %>%
    fit(Weekly_Sales ~ Date + id, training(splits))