Extract the top k trials from a module's optimization history or a TrialLog, ranked by score.
Usage
top_trials(x, k = 5L, objective = c("maximize", "minimize"))Value
A tibble with the top k trials, including trial_id, score, parameters, and other trial metadata.
See also
Other optimizer accessors:
apply_best_config(),
best_demos(),
best_params(),
config_diff(),
export_module_code(),
optimization_summary()
Examples
if (FALSE) {
# Get top 3 trials from module
top_trials(mod, k = 3)
# Get top trials from a TrialLog
log <- load_trial_log("path/to/logs")
top_trials(log, k = 10, objective = "minimize")
}
