Skip to content

Commit 0804b44

Browse files
committed
rename featureunion in ppls
1 parent 11a22ce commit 0804b44

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# mlr3pipelines 0.5.0-9000
22

3+
* Changed the ID of `PipeOpFeatureUnion` used in `ppl("robustify")` and `ppl("stacking")`
34
* Feature: The `$add_pipeop()` method got an argument `clone` (old behaviour `TRUE` by default)
45
* Bugfix: `PipeOpFeatureUnion` in some rare cases dropped variables called `"x"`
56
* Compatibility with upcoming paradox release

R/pipeline_robustify.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ pipeline_robustify = function(task = NULL, learner = NULL,
170170
imputing,
171171
po("missind", affect_columns = selector_type(c("numeric", "integer", "logical")), type = if (missind_numeric) "numeric" else "factor")
172172
)),
173-
if (has_numbers || has_logicals) po("featureunion"),
173+
if (has_numbers || has_logicals) po("featureunion", id = "featureunion_robustify"),
174174
if (has_factorials) po("imputeoor")
175175
)
176176

R/pipeline_stacking.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pipeline_stacking = function(base_learners, super_learner, method = "cv", folds
5353
if (use_features) base_learners_cv = c(base_learners_cv, po("nop"))
5454

5555
gunion(base_learners_cv, in_place = TRUE) %>>!%
56-
po("featureunion") %>>!%
56+
po("featureunion", id = "featureunion_stacking") %>>!%
5757
super_learner
5858
}
5959

tests/testthat/test_ppl.R

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,19 @@ test_that("mlr_pipeops multi-access works", {
5757
expect_equal(ppls(), mlr_graphs)
5858

5959
})
60+
61+
test_that("mlr3book authors don't sleepwalk through life", {
62+
63+
tasks = tsks(c("breast_cancer", "sonar"))
64+
65+
66+
glrn_stack = as_learner(ppl("robustify") %>>% ppl("stacking",
67+
lrns(c("classif.rpart", "classif.debug")),
68+
lrn("classif.log_reg")
69+
))
70+
glrn_stack$id = "Stack"
71+
72+
learners = c(glrn_stack)
73+
bmr = benchmark(benchmark_grid(tasks, learners, rsmp("cv", folds = 3)))
74+
75+
})

0 commit comments

Comments
 (0)