File: test_tune_getTuneResultOptPath.R

package info (click to toggle)
r-cran-mlr 2.19.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,392 kB
  • sloc: ansic: 65; sh: 13; makefile: 5
file content (13 lines) | stat: -rwxr-xr-x 492 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13

test_that("getTuneResultOptPath", {
  ctrl = makeTuneControlRandom(maxit = 3L)
  rdesc = makeResampleDesc("CV", iters = 3L)
  ps = makeParamSet(
    makeDiscreteParam("C", values = seq(1:10)))
  rdesc = makeResampleDesc("CV", iters = 3L)
  res = tuneParams("classif.ksvm", task = iris.task, resampling = rdesc,
    par.set = ps, control = ctrl)

  expect_equal(res$opt.path, getTuneResultOptPath(res, as.df = FALSE))
  expect_equal(as.data.frame(res$opt.path), getTuneResultOptPath(res))
})