Skip to content

Commit 04aa27b

Browse files
Clean devtools test (#278)
Co-authored-by: Max Kuhn <[email protected]>
1 parent 312eb32 commit 04aa27b

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

tests/testthat/_snaps/survival-tune-sa.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
Code
1515
expect_snapshot_plot(print(autoplot(sa_dynamic_res)), "dyn-sa")
1616

17+
---
18+
19+
Code
20+
expect_snapshot_plot(print(autoplot(sa_dynamic_res, eval_time = 1, type = "parameters")),
21+
"dyn-sa-param")
22+
Condition
23+
Warning:
24+
`eval_time` is not used with `autoplot(..., type = 'parameters')`.
25+
1726
# sim annealing tuning survival models with mixture of metric types
1827

1928
Code
@@ -30,6 +39,15 @@
3039
Code
3140
expect_snapshot_plot(print(autoplot(sa_mixed_res)), "mix-sa-0-times")
3241

42+
---
43+
44+
Code
45+
expect_snapshot_plot(print(autoplot(sa_mixed_res, eval_time = 1, type = "parameters")),
46+
"mix-sa-param")
47+
Condition
48+
Warning:
49+
`eval_time` is not used with `autoplot(..., type = 'parameters')`.
50+
3351
---
3452

3553
Code

tests/testthat/test-stacks-tuning.R

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,10 @@ spec_lr <-
4444
set_mode("regression")
4545

4646
spec_bt <-
47-
boost_tree(mtry = tune(), min_n = tune()) %>%
47+
boost_tree(learn_rate = tune(), min_n = tune()) %>%
4848
set_engine("xgboost") %>%
4949
set_mode("regression")
5050

51-
spec_dt <-
52-
decision_tree(cost_complexity = tune(), tree_depth = tune()) %>%
53-
set_engine("rpart") %>%
54-
set_mode("regression")
55-
5651
spec_svm <-
5752
svm_linear(cost = tune(), margin = tune()) %>%
5853
set_engine("LiblineaR") %>%
@@ -61,7 +56,7 @@ spec_svm <-
6156
wf_set <-
6257
workflow_set(
6358
preproc = list(rec = base_rec),
64-
models = list(lr = spec_lr, bt = spec_bt, dt = spec_dt, svm = spec_svm),
59+
models = list(lr = spec_lr, bt = spec_bt, svm = spec_svm),
6560
cross = TRUE
6661
)
6762

tests/testthat/test-survival-tune-sa.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,11 @@ test_that("sim annealing tuning survival models with dynamic metric", {
434434
"dyn-sa"
435435
)
436436
)
437-
expect_snapshot_plot(
438-
print(autoplot(sa_dynamic_res, type = "parameters")),
439-
"dyn-sa-param"
437+
expect_snapshot(
438+
expect_snapshot_plot(
439+
print(autoplot(sa_dynamic_res, eval_time = 1, type = "parameters")),
440+
"dyn-sa-param"
441+
)
440442
)
441443
expect_snapshot_plot(
442444
print(autoplot(sa_dynamic_res, eval_time = 10, type = "performance")),
@@ -625,9 +627,11 @@ test_that("sim annealing tuning survival models with mixture of metric types", {
625627
"mix-sa-0-times"
626628
)
627629
)
628-
expect_snapshot_plot(
629-
print(autoplot(sa_mixed_res, type = "parameters")),
630-
"mix-sa-param"
630+
expect_snapshot(
631+
expect_snapshot_plot(
632+
print(autoplot(sa_mixed_res, eval_time = 1, type = "parameters")),
633+
"mix-sa-param"
634+
)
631635
)
632636
expect_snapshot_plot(
633637
print(autoplot(sa_mixed_res, eval_time = 10, type = "performance")),

0 commit comments

Comments
 (0)