Skip to content

Commit

Permalink
adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mb706 committed Mar 26, 2024
1 parent 0fefbbc commit 47e3ee5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test_mlr_graphs_stacking.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_that("Stacking Pipeline", {
# default
graph_stack = pipeline_stacking(base_learners, super_learner)
expect_graph(graph_stack)
expect_names(graph_stack$ids(), identical.to = c("base.rpart", "nop", "featureunion", "super.rpart"))
expect_names(graph_stack$ids(), identical.to = c("base.rpart", "nop", "featureunion_stacking", "super.rpart"))
graph_learner = as_learner(graph_stack)
graph_learner$train(tsk("iris"))
expect_class(graph_learner$model$super.rpart$model, "rpart")
Expand All @@ -19,7 +19,7 @@ test_that("Stacking Pipeline", {
# no nop
graph_stack = pipeline_stacking(base_learners, super_learner, use_features = FALSE)
expect_graph(graph_stack)
expect_names(graph_stack$ids(), identical.to = c("base.rpart", "featureunion", "super.rpart"))
expect_names(graph_stack$ids(), identical.to = c("base.rpart", "featureunion_stacking", "super.rpart"))
graph_learner = as_learner(graph_stack)
graph_learner$train(tsk("iris"))
expect_class(graph_learner$model$super.rpart$model, "rpart")
Expand All @@ -28,7 +28,7 @@ test_that("Stacking Pipeline", {
# folds
graph_stack = pipeline_stacking(base_learners, super_learner, folds = 5)
expect_graph(graph_stack)
expect_names(graph_stack$ids(), identical.to = c("base.rpart", "nop", "featureunion", "super.rpart"))
expect_names(graph_stack$ids(), identical.to = c("base.rpart", "nop", "featureunion_stacking", "super.rpart"))
graph_learner = as_learner(graph_stack)
graph_learner$train(tsk("iris"))
expect_equal(graph_learner$graph$pipeops$base.rpart$param_set$values$resampling.folds, 5)
Expand All @@ -38,7 +38,7 @@ test_that("Stacking Pipeline", {
# insample
graph_stack = pipeline_stacking(base_learners, super_learner, method = "insample")
expect_graph(graph_stack)
expect_names(graph_stack$ids(), identical.to = c("base.rpart", "nop", "featureunion", "super.rpart"))
expect_names(graph_stack$ids(), identical.to = c("base.rpart", "nop", "featureunion_stacking", "super.rpart"))
graph_learner = as_learner(graph_stack)
graph_learner$train(tsk("iris"))
expect_equal(graph_learner$graph$pipeops$base.rpart$param_set$values$resampling.method, "insample")
Expand Down

0 comments on commit 47e3ee5

Please sign in to comment.