tests/testthat/test-random-integer-neighbors.R

test_that("random integers in range", {
  set.seed(123)
  parameters <- dials::parameters(list(dials::tree_depth(range = c(2, 3))))
  random_integer_neigbors <-
    purrr::map_dfr(
      1:500,
      ~ finetune:::random_integer_neighbor_calc(
        tibble::tibble(tree_depth = 3),
        parameters, 0.75, FALSE
      )
    )


  expect_true(all(random_integer_neigbors$tree_depth >= 2))
  expect_true(all(random_integer_neigbors$tree_depth <= 3))
})

Try the finetune package in your browser

Any scripts or data that you put into this service are public.

finetune documentation built on May 29, 2024, 5:35 a.m.