tests/testthat/test_FilterPerformance.R

test_that("FilterPerformance", {
  task = mlr3::mlr_tasks$get("iris")
  learner = mlr3::mlr_learners$get("classif.rpart")
  resampling = rsmp("holdout")
  f = flt("performance", learner = learner, resampling = resampling)

  f$calculate(task)
  expect_filter(f, task = task)
  expect_true(all(f$scores <= 0))
})

Try the mlr3filters package in your browser

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

mlr3filters documentation built on Feb. 16, 2023, 7:29 p.m.