Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make helper function to pull wflw_fit from boilerplate functions #342

Closed
spsanderson opened this issue Jul 26, 2022 · 0 comments
Closed
Assignees
Labels

Comments

@spsanderson
Copy link
Owner

Example:

library(tidyverse)
library(healthyverse)
library(timetk)
library(modeltime)

df <- AirPassengers %>%
  ts_to_tbl() %>%
  select(-index)

splits <- time_series_split(
  df
  , date_col
  , assess = 12
  , skip = 3
  , cumulative = TRUE
)

ts_auto_arima <- ts_auto_arima(
  .data = df,
  .num_cores = 5,
  .date_col = date_col,
  .value_col = value,
  .rsamp_obj = splits,
  .formula = value ~ .,
  .grid_size = 20,
  .cv_slice_limit = 2
)

model_fit <- ts_auto_arima$model_info$fitted_wflw

Possible function:

ts_extract_auto_fitted_workflow <- function(.input){
  
  # Input
  input <- .input
  
  # Extract Fitted Workflow
  fitted_wfwl <- input$model_info$fitted_wflw
  
  return(fitted_wfwl)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant