This function retrieves the final forecast for a Finn agent after the forecast iteration process is complete.
get_agent_forecast(agent_info, parallel_processing = NULL, num_cores = NULL)
Agent info from set_agent_info()
Default of NULL runs no parallel processing and loads each time series forecast one after another. 'local_machine' leverages all cores on current machine Finn is running on. 'spark' runs time series in parallel on a spark cluster in Azure Databricks or Azure Synapse.
Number of cores to use for parallel processing. If NULL, defaults to the number of available cores.
A tibble containing the final forecast for the agent.
if (FALSE) { # \dontrun{
# load example data
hist_data <- timetk::m4_monthly %>%
dplyr::filter(date >= "2013-01-01") %>%
dplyr::rename(Date = date) %>%
dplyr::mutate(id = as.character(id))
# set up Finn project
project <- set_project_info(
project_name = "Demo_Project",
combo_variables = c("id"),
target_variable = "value",
date_type = "month"
)
# set up LLM
driver_llm <- ellmer::chat_azure_openai(model = "gpt-4o-mini")
# set up agent info
agent_info <- set_agent_info(
project_info = project,
driver_llm = driver_llm,
input_data = hist_data,
forecast_horizon = 6
)
# run the forecast iteration process
iterate_forecast(
agent_info = agent_info,
max_iter = 3,
weighted_mape_goal = 0.03
)
# get the final forecast for the agent
final_forecast <- get_agent_forecast(agent_info = agent_info)
} # }