tests/testthat/test_base_getParamSet.R

test_that("getParamSet", {
  lrn = makeLearner("classif.lda")
  ps = getParamSet(lrn)
  expect_true(setequal(names(ps$pars), c("method", "nu", "tol", "predict.method", "CV", "prior")))

  lrn = makeFilterWrapper(lrn)
  ps = getParamSet(lrn)
  expect_true(all(c("method", "fw.method") %in% names(ps$pars)))

  lrn = makeModelMultiplexer(list(setLearnerId(lrn, "x")))
  ps = getParamSet(lrn)
  expect_true(all(c("x.method", "x.fw.method", "selected.learner") %in% names(ps$pars)))

  expect_true("type" %in% names(getParamSet("classif.ksvm")$pars))
})

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.