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

Details

For non-agentic standard or grouped hierarchical runs, returns every successfully saved per-model reconciled forecast together with Best-Model. Filter Best_Model == "Yes" to retain only the reconciled selected forecast. Best-Model can combine different winning models or averages across series; it does not require one model family to win everywhere. Models that did not successfully produce a reconciled artifact are not added to the output.

Use get_agent_forecast() for final Agent results. Hierarchical Agent output contains only the reconciled selected forecast, because iterate_forecast() can run different model and recipe sets for different series. It is not an all-model reconciled comparison table.

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
#> • Project Name: finn_project
#> • Run Name: finn_fcst-20261002T154347Z
#> 

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 [796ms]
#> 

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

#> ✔ Creating Train Test Splits [402ms]
#> 

train_models(run_info,
  run_local_models = TRUE
)
#> ℹ Training Individual Models
#> ✔ Training Individual Models [15.9s]
#> 

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

fcst_tbl <- get_forecast_data(run_info)
# }