Skip to content

Commit

Permalink
metric is not needed when parameters is specified (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
hfrick authored Feb 29, 2024
1 parent 02b3fff commit 59dcd04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-fit_best.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test_that("fit_best fits with correct hyperparameters", {
rankings <- rank_results(chi_features_map, "rmse")
tune_res <- extract_workflow_set_result(chi_features_map, rankings$wflow_id[1])
tune_params <- select_best(tune_res, metric = "rmse")
manual_wf <- fit_best(tune_res, "rmse", parameters = tune_params)
manual_wf <- fit_best(tune_res, parameters = tune_params)

expect_equal(manual_wf, fit_best_wf)

Expand All @@ -47,7 +47,7 @@ test_that("fit_best fits with correct hyperparameters", {
rankings_2 <- rank_results(chi_features_map, "iic")
tune_res_2 <- extract_workflow_set_result(chi_features_map, rankings_2$wflow_id[1])
tune_params_2 <- select_best(tune_res_2, metric = "iic")
manual_wf_2 <- fit_best(tune_res_2, "iic", parameters = tune_params_2)
manual_wf_2 <- fit_best(tune_res_2, parameters = tune_params_2)

expect_equal(manual_wf_2, fit_best_wf_2)
})
Expand Down

0 comments on commit 59dcd04

Please sign in to comment.