Skip to content

Commit

Permalink
improve metric checking in show_best.tune_race() (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Jan 18, 2024
1 parent b31a748 commit 5714286
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ URL: https://github.com/tidymodels/finetune,
BugReports: https://github.com/tidymodels/finetune/issues
Depends:
R (>= 3.5),
tune (>= 1.1.2.9004)
tune (>= 1.1.2.9011)
Imports:
cli,
dials (>= 0.1.0),
Expand Down
2 changes: 1 addition & 1 deletion R/racing_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,10 @@ collect_metrics.tune_race <- function(x, summarize = TRUE, all_configs = FALSE,
#' different resamples is likely to lead to inappropriate results.
#' @export
show_best.tune_race <- function(x, metric = NULL, n = 5, eval_time = NULL, ...) {

if (!is.null(metric)) {
# What was used to judge the race and how are they being sorted now?
metrics <- tune::.get_tune_metrics(x)
tune::check_metric_in_tune_results(tibble::as_tibble(metrics), metric)
opt_metric <- tune::first_metric(metrics)
opt_metric_name <- opt_metric$metric
if (metric[1] != opt_metric_name) {
Expand Down

0 comments on commit 5714286

Please sign in to comment.