Skip to content

Commit 5df0fc2

Browse files
authored
Merge pull request #906 from mlr-org/compat_mlr3_dev
Change tests to be compatible `mlr3` dev version `0.23.0.9000`
2 parents 6a5e723 + 8e77868 commit 5df0fc2

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

tests/testthat/test_pipeop_colapply.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ test_that("apply results look as they should", {
120120

121121
test_that("empty task", {
122122

123-
task = tsk("iris")$filter(0L)
123+
task = tsk("iris")$filter(integer(0))
124124
po = PipeOpColApply$new()
125125
po$param_set$values$applicator = function(x) as.integer(x)
126126

tests/testthat/test_pipeop_rowapply.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ test_that("PipeOpRowApply - transform works on task with only one row", {
354354
test_that("PipeOpRowApply - transform works on empty task (no rows)", {
355355

356356
op = PipeOpRowApply$new()
357-
task = mlr_tasks$get("wine")$filter(0)
357+
task = mlr_tasks$get("wine")$clone(deep = TRUE)$filter(integer(0))
358358
cnames = task$feature_names
359359

360360
# applicator generates matrix with names
@@ -426,7 +426,7 @@ test_that("PipeOpRowApply - transform works for empty predict task (no rows)", {
426426

427427
op = PipeOpRowApply$new()
428428
task_train = mlr_tasks$get("wine")
429-
task_predict = task_train$filter(0)
429+
task_predict = task_train$clone(deep = TRUE)$filter(integer(0))
430430
cnames = task_train$feature_names
431431

432432
# applicator generates matrix with names

tests/testthat/test_pipeop_tunethreshold.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ test_that("threshold respects minimization / maximization", {
135135
po("tunethreshold", measure = msr("classif.bacc"), optimizer = "random_search")
136136

137137
learner1 = as_learner(graph)
138-
learner2 = lrn("classif.rpart")
138+
learner2 = lrn("classif.rpart", predict_type = "prob")
139139

140140
design = benchmark_grid(
141141
task,
@@ -221,7 +221,7 @@ test_that("threshold works with cost measure", {
221221
learner2 = GraphLearner$new(graph2, id = "fpr.minimizer")
222222
design = benchmark_grid(
223223
task,
224-
list(learner1, learner2, lrn("classif.rpart")),
224+
list(learner1, learner2, lrn("classif.rpart", predict_type = "prob")),
225225
rsmp("cv", folds = 10)
226226
)
227227

tests/testthat/test_utils.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ test_that("task_filter_ex - changed row_roles$use", {
6565
task$row_roles$use = seq(1, 50)
6666
tfiltered = task_filter_ex(task$clone(), rowidx)
6767
expect_equal(tfiltered$data(), task$data(rows = rowidx))
68-
69-
task$row_roles$use = c(seq(1, 50), seq(1, 20))
70-
tfiltered = task_filter_ex(task$clone(), 50L + rowidx)
71-
expect_equal(tfiltered$data(), task$data(rows = 50L + rowidx))
7268
})
7369

7470
test_that("task_filter_ex - group renaming in changed row_roles$use", {

0 commit comments

Comments
 (0)