Skip to content

Commit

Permalink
Merge pull request #985 from tidymodels/2025-02-cran-updates
Browse files Browse the repository at this point in the history
updates for new CRAN versions (esp dials)
  • Loading branch information
hfrick authored Feb 21, 2025
2 parents d62199a + d7241e0 commit acb4bee
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/bayes.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@
}, save_pred = TRUE))
Message
x Fold1: preprocessor 1/1:
Error in `get_all_predictors()`:
Error in `hardhat::mold()`:
! The following predictor was not found in `data`: "z".
x Fold2: preprocessor 1/1:
Error in `get_all_predictors()`:
Error in `hardhat::mold()`:
! The following predictor was not found in `data`: "z".
Condition
Warning:
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
}, save_pred = TRUE))
Message
x Fold1: preprocessor 1/1:
Error in `get_all_predictors()`:
Error in `hardhat::mold()`:
! The following predictor was not found in `data`: "z".
x Fold2: preprocessor 1/1:
Error in `get_all_predictors()`:
Error in `hardhat::mold()`:
! The following predictor was not found in `data`: "z".
Condition
Warning:
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/select_best.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# A tibble: 1 x 5
deg_free degree `wt df` `wt degree` .config
<int> <int> <int> <int> <chr>
1 6 2 2 1 Preprocessor05_Model1
1 6 2 2 1 Preprocessor19_Model1

---

Expand Down Expand Up @@ -74,7 +74,7 @@
# A tibble: 1 x 5
deg_free degree `wt df` `wt degree` .config
<int> <int> <int> <int> <chr>
1 6 2 2 1 Preprocessor05_Model1
1 6 2 2 1 Preprocessor19_Model1

---

Expand Down Expand Up @@ -153,7 +153,7 @@
# A tibble: 1 x 5
deg_free degree `wt df` `wt degree` .config
<int> <int> <int> <int> <chr>
1 6 2 2 1 Preprocessor05_Model1
1 6 2 2 1 Preprocessor19_Model1

---

Expand Down
Binary file modified tests/testthat/data/knn_gp.rds
Binary file not shown.
Binary file modified tests/testthat/data/knn_grid.rds
Binary file not shown.
Binary file modified tests/testthat/data/knn_results.rds
Binary file not shown.
Binary file modified tests/testthat/data/knn_set.rds
Binary file not shown.
Binary file modified tests/testthat/data/lm_bayes.rds
Binary file not shown.
Binary file modified tests/testthat/data/lm_resamples.rds
Binary file not shown.
Binary file modified tests/testthat/data/rcv_results.rds
Binary file not shown.
Binary file modified tests/testthat/data/surv_boost_tree_res.rds
Binary file not shown.
Binary file modified tests/testthat/data/svm_reg_results.rds
Binary file not shown.
Binary file modified tests/testthat/data/svm_results.rds
Binary file not shown.
Binary file modified tests/testthat/data/test_objects.RData
Binary file not shown.
4 changes: 2 additions & 2 deletions tests/testthat/test-GP.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("encoding before model", {
skip_if_not_installed("dials", minimum_version = "1.4.0")
knn_set <- readRDS(test_path("data", "knn_set.rds"))
knn_grid <- readRDS(test_path("data", "knn_grid.rds"))

Expand Down Expand Up @@ -39,8 +40,7 @@ test_that("GP fit - knn", {
"K", "weight_funcrectangular", "weight_functriangular",
"weight_funcepanechnikov", "weight_funcbiweight",
"weight_functriweight", "weight_funccos", "weight_funcinv",
"weight_funcgaussian", "weight_funcrank", "weight_funcoptimal",
"exponent"
"weight_funcgaussian", "weight_funcrank", "exponent"
)
expect_equal(class(knn_gp), "GP")
expect_equal(colnames(knn_gp$X), knn_cols)
Expand Down
7 changes: 5 additions & 2 deletions tests/testthat/test-select_best.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# ------------------------------------------------------------------------------

test_that("select_best()", {
skip_if_not_installed("dials", minimum_version = "1.4.0")
options(width = 200, pillar.advice = FALSE, pillar.min_title_chars = Inf)

rcv_results <- readRDS(test_path("data", "rcv_results.rds"))
Expand Down Expand Up @@ -82,6 +83,7 @@ test_that("show_best()", {
})

test_that("one-std error rule", {
skip_if_not_installed("dials", minimum_version = "1.4.0")
options(width = 200, pillar.advice = FALSE, pillar.min_title_chars = Inf)

rcv_results <- readRDS(test_path("data", "rcv_results.rds"))
Expand All @@ -93,7 +95,7 @@ test_that("one-std error rule", {

expect_equal(
select_by_one_std_err(rcv_results, metric = "rmse", deg_free, `wt degree`)$.config,
"Preprocessor05_Model1"
"Preprocessor19_Model1"
)
expect_equal(
select_by_one_std_err(knn_results, metric = "accuracy", K)$K,
Expand Down Expand Up @@ -135,6 +137,7 @@ test_that("one-std error rule", {


test_that("percent loss", {
skip_if_not_installed("dials", minimum_version = "1.4.0")
options(width = 200, pillar.advice = FALSE, pillar.min_title_chars = Inf)

rcv_results <- readRDS(test_path("data", "rcv_results.rds"))
Expand All @@ -145,7 +148,7 @@ test_that("percent loss", {
)
expect_equal(
select_by_pct_loss(rcv_results, metric = "rmse", deg_free, `wt degree`)$.config,
"Preprocessor05_Model1"
"Preprocessor19_Model1"
)
expect_equal(
select_by_pct_loss(knn_results, metric = "accuracy", K)$K,
Expand Down

0 comments on commit acb4bee

Please sign in to comment.