R/agent_summarize_models.R
get_summarized_models.RdThis function retrieves the final summarized model info (hyperparameters,
recipe steps, feature importance, etc.) after an agent completes its run.
Built-in variable-importance rows are included when the optional vip package was
available while summaries were generated; all other summary sections remain
available without it.
Custom models expose their exact version, confirmed interpretation and
representation without source text or arbitrary fitted-state introspection.
Driver importance is the mean signed increase in historical holdout RMSE
under ten deterministic cyclic permutations, conditional on supplied drivers.
It is not causal attribution or a percentage. Generating these summaries
refits trusted custom source once per fitted workflow on earlier history and
predicts complete holdout cohorts; no-driver models need no diagnostic fit.
Non-estimable cases are disclosed through warnings and method/status rows.
get_summarized_models(agent_info)Agent info from set_agent_info()
A tibble containing the summarized models for the agent.
Built-in importance sections may be omitted without vip. Custom
importance does not require vip. Existing saved summaries are not migrated;
newly generated summaries can contain additional importance metadata rows.
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
llm <- ellmer::chat_azure_openai(model = "gpt-4o-mini")
# set up agent info
agent_info <- set_agent_info(
project_info = project,
llm = 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 model summaries for an agent
model_summary <- get_summarized_models(agent_info = agent_info)
} # }