Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/testthat/_snaps/survival-tune-sa.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
Code
expect_snapshot_plot(print(autoplot(sa_dynamic_res)), "dyn-sa")

---

Code
expect_snapshot_plot(print(autoplot(sa_dynamic_res, eval_time = 1, type = "parameters")),
"dyn-sa-param")
Condition
Warning:
`eval_time` is not used with `autoplot(..., type = 'parameters')`.

# sim annealing tuning survival models with mixture of metric types

Code
Expand All @@ -30,6 +39,15 @@
Code
expect_snapshot_plot(print(autoplot(sa_mixed_res)), "mix-sa-0-times")

---

Code
expect_snapshot_plot(print(autoplot(sa_mixed_res, eval_time = 1, type = "parameters")),
"mix-sa-param")
Condition
Warning:
`eval_time` is not used with `autoplot(..., type = 'parameters')`.

---

Code
Expand Down
9 changes: 2 additions & 7 deletions tests/testthat/test-stacks-tuning.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@ spec_lr <-
set_mode("regression")

spec_bt <-
boost_tree(mtry = tune(), min_n = tune()) %>%
boost_tree(learn_rate = tune(), min_n = tune()) %>%
set_engine("xgboost") %>%
set_mode("regression")

spec_dt <-
decision_tree(cost_complexity = tune(), tree_depth = tune()) %>%
set_engine("rpart") %>%
set_mode("regression")

spec_svm <-
svm_linear(cost = tune(), margin = tune()) %>%
set_engine("LiblineaR") %>%
Expand All @@ -61,7 +56,7 @@ spec_svm <-
wf_set <-
workflow_set(
preproc = list(rec = base_rec),
models = list(lr = spec_lr, bt = spec_bt, dt = spec_dt, svm = spec_svm),
models = list(lr = spec_lr, bt = spec_bt, svm = spec_svm),
cross = TRUE
)

Expand Down
16 changes: 10 additions & 6 deletions tests/testthat/test-survival-tune-sa.R
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,11 @@ test_that("sim annealing tuning survival models with dynamic metric", {
"dyn-sa"
)
)
expect_snapshot_plot(
print(autoplot(sa_dynamic_res, eval_time = 1, type = "parameters")),
"dyn-sa-param"
expect_snapshot(
expect_snapshot_plot(
print(autoplot(sa_dynamic_res, eval_time = 1, type = "parameters")),
"dyn-sa-param"
)
)
expect_snapshot_plot(
print(autoplot(sa_dynamic_res, eval_time = 10, type = "performance")),
Expand Down Expand Up @@ -625,9 +627,11 @@ test_that("sim annealing tuning survival models with mixture of metric types", {
"mix-sa-0-times"
)
)
expect_snapshot_plot(
print(autoplot(sa_mixed_res, eval_time = 1, type = "parameters")),
"mix-sa-param"
expect_snapshot(
expect_snapshot_plot(
print(autoplot(sa_mixed_res, eval_time = 1, type = "parameters")),
"mix-sa-param"
)
)
expect_snapshot_plot(
print(autoplot(sa_mixed_res, eval_time = 10, type = "performance")),
Expand Down
Loading