From 2c6d162acb570b3fc6f527c960b4607026866d77 Mon Sep 17 00:00:00 2001 From: "Simon P. Couch" Date: Tue, 6 Aug 2024 16:25:39 -0500 Subject: [PATCH] TDD prep: fix GHA with new dials interface (#117) * re`document()` with new roxygen * transition to new dials interface in tests * propose a `min_n` less prone to overfit --- DESCRIPTION | 4 ++-- tests/testthat/test-sa-overall.R | 2 +- tests/testthat/test-win-loss-overall.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 53d25d7..9316a8f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,7 @@ Depends: tune (>= 1.2.0) Imports: cli, - dials (>= 0.1.0), + dials (>= 0.3.0), dplyr (>= 1.1.1), ggplot2, parsnip (>= 1.1.0), @@ -54,4 +54,4 @@ Config/testthat/edition: 3 Encoding: UTF-8 Language: en-US Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 diff --git a/tests/testthat/test-sa-overall.R b/tests/testthat/test-sa-overall.R index ad20a34..daaa427 100644 --- a/tests/testthat/test-sa-overall.R +++ b/tests/testthat/test-sa-overall.R @@ -138,7 +138,7 @@ test_that("incompatible parameter objects", { set.seed(1) grid_with_bigger_range <- - dials::grid_latin_hypercube(dials::mtry(range = c(1, 16))) + dials::grid_space_filling(dials::mtry(range = c(1, 16))) set.seed(1) car_folds <- rsample::vfold_cv(car_prices, v = 2) diff --git a/tests/testthat/test-win-loss-overall.R b/tests/testthat/test-win-loss-overall.R index bb9e19d..71d0d7b 100644 --- a/tests/testthat/test-win-loss-overall.R +++ b/tests/testthat/test-win-loss-overall.R @@ -77,7 +77,7 @@ test_that("one player is really bad", { add_formula(y ~ .) %>% add_model(rf_spec) - grid <- tibble(min_n = c(1, 400)) + grid <- tibble(min_n = c(1, 40)) ctrl <- control_race(burn_in = 2, alpha = .05, randomize = TRUE) set.seed(3355) tuning_results <- tune_race_win_loss(