Get Final Forecast Data

get_forecast_data(run_info, return_type = "df")

Arguments

run_info

run info using the set_run_info() function

return_type

return type

Value

table of final forecast results

Examples

# \donttest{
data_tbl <- timetk::m4_monthly %>%
  dplyr::rename(Date = date) %>%
  dplyr::mutate(id = as.character(id)) %>%
  dplyr::filter(
    id == "M2",
    Date >= "2012-01-01",
    Date <= "2015-06-01"
  )

run_info <- set_run_info()
#> Finn Submission Info
#>  Experiment Name: finn_fcst
#>  Run Name: finn_fcst-20240429T224818Z
#> 

prep_data(run_info,
  input_data = data_tbl,
  combo_variables = c("id"),
  target_variable = "value",
  date_type = "month",
  forecast_horizon = 3,
  recipes_to_run = "R1"
)
#>  Prepping Data
#>  Prepping Data [410ms]
#> 

prep_models(run_info,
  models_to_run = c("arima", "ets"),
  num_hyperparameters = 1
)
#>  Creating Model Workflows
#>  Creating Model Workflows [78ms]
#> 
#>  Creating Model Hyperparameters
#>  Creating Model Hyperparameters [83ms]
#> 
#>  Creating Train Test Splits
#>  Turning ensemble models off since no multivariate models were chosen to run.
#>  Creating Train Test Splits

#>  Creating Train Test Splits [354ms]
#> 

train_models(run_info,
  run_local_models = TRUE
)
#>  Training Individual Models
#>A | warning: A correlation computation is required, but the inputs are size zero or one and
#>                the standard deviation cannot be computed. `NA` will be returned.
#>  Training Individual Models

#>B | warning: A correlation computation is required, but `estimate` is constant and has 0
#>                standard deviation, resulting in a divide by 0 error. `NA` will be returned.
#>  Training Individual Models

#> There were issues with some computations   A: x2   B: x1
#> There were issues with some computations   A: x3   B: x2
#> 
#>  Training Individual Models

#>A | warning: A correlation computation is required, but the inputs are size zero or one and
#>                the standard deviation cannot be computed. `NA` will be returned.
#>  Training Individual Models

#> There were issues with some computations   A: x1
#>B | warning: A correlation computation is required, but `estimate` is constant and has 0
#>                standard deviation, resulting in a divide by 0 error. `NA` will be returned.
#> There were issues with some computations   A: x1

#> There were issues with some computations   A: x2   B: x6
#> There were issues with some computations   A: x3   B: x7
#> 
#>  Training Individual Models

#>  Training Individual Models [10.1s]
#> 

final_models(run_info,
  average_models = FALSE
)
#>  Selecting Best Models
#>  Selecting Best Models [194ms]
#> 

fcst_tbl <- get_forecast_data(run_info)
# }