business-science / modeltime

Modeltime unlocks time series forecast models and machine learning in one framework
https://business-science.github.io/modeltime/
Other
535 stars 82 forks source link

Recursive Forecasting Vignette #74

Closed mdancho84 closed 3 years ago

mdancho84 commented 3 years ago

We should add a short vignette that discusses the new recursive() functionality for forecasting described here: https://business-science.github.io/modeltime/reference/recursive.html

Teett commented 3 years ago

Hi Matt! New here. Something crosses my mind that I don't see specified in the vignette.

Is there a way in the new recursive() function to specify two "id" columns? I'm thinking in your hierarchical forecasting problem where you showcased a "category" and "identifier" schema. Maybe something that looks like this?

fit(training(splits)) %>% 
  recursive(
          id         = c("category", "identifier"),
          transform  = lag_roll_transformer_grouped,
          train_tail = panel_tail(data_prepared_tbl, c("category", "identifier"), n = FORECAST_HORIZON)
      )
mdancho84 commented 3 years ago

So, we could try to accommodate this down the road, but the easiest thing to do is to create a new column that is a combination of the two columns. This way each identifier is specific to the sub-series. This is generally good practice when modeling time series, rather than having multiple "identifier" columns.

mdancho84 commented 3 years ago

@Teett I'm thinking we should leave it as just a single column. The best-practice is to use a single column as the ID.