tests/testthat/test_resample.R

context("resample")

test_that("PipeOp - Resample", {
  task = mlr_tasks$get("iris")
  op1 = PipeOpScale$new()
  lrn = mlr_learners$get("classif.rpart")
  op2 = PipeOpLearner$new(learner = lrn)
  pp = GraphLearner$new(op2)
  resa = mlr_resamplings$get("cv")
  resa$param_set$values$folds = 2L

  rr = mlr3::resample(task, pp, resa)
  assert_resample_result(rr)
  expect_class(rr, "ResampleResult")
})

Try the mlr3pipelines package in your browser

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

mlr3pipelines documentation built on Sept. 21, 2022, 9:09 a.m.