tests/testthat/test_base_resample_makeResampleDesc.R

test_that("makeResampleDesc", {
  desc1 = makeResampleDesc("CV", predict = "test", iters = 2)
  expect_equal(desc1$iters, 2)
  expect_equal(desc1$predict, "test")
  expect_error(makeResampleDesc("Foo", predict = "test", iters = 2),
    "Assertion on 'method' failed: Must be element of set")
  expect_error(makeResampleDesc("CV", predict = "Foo", iters = 2),
    "Assertion on 'predict' failed: Must be element of set")
})

Try the mlr package in your browser

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

mlr documentation built on Sept. 29, 2022, 5:05 p.m.