tests/testthat/test_mbo_resample.R

context("mbo resample")

test_that("mbo works with resampling", {
  learner = makeLearner("regr.randomForest", predict.type = "se", se.method = "sd")
  ctrl = makeMBOControl(resample.at = c(1, 3))
  ctrl = setMBOControlTermination(ctrl, iters = 5L)
  ctrl = setMBOControlInfill(ctrl, opt.focussearch.points = 10L)
  or = mbo(testf.fsphere.2d, testd.fsphere.2d, learner, ctrl)
  x = or$resample.results
  expect_list(x, len = 2)
  expect_true(is.numeric(x[[1]]$aggr) && is.numeric(x[[2]]$aggr))
  expect_equal(names(x), c("1", "3"))
})

Try the mlrMBO package in your browser

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

mlrMBO documentation built on July 4, 2022, 9:05 a.m.