Skip to content

Commit ac09cae

Browse files
committed
undo bogus changes
1 parent fb62bbc commit ac09cae

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

NEWS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# mlr3pipelines 0.5.2-9000
22

3-
43
* Compatibility with new `bbotk` release.
54
* Added marshaling support to `GraphLearner`
65
* Support internal tuning and validation

R/pipeline_branch.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ pipeline_branch = function(graphs, prefix_branchops = "", prefix_paths = FALSE)
9191
pmap(list(
9292
src_id = branch_id, dst_id = gin$op.id,
9393
src_channel = branch_chan, dst_channel = gin$channel.name),
94-
graph$add_edge)
94+
graph$add_edge)
9595
})
9696
graph
9797
}
9898

9999
mlr_graphs$add("branch", pipeline_branch)
100+

tests/testthat/test_GraphLearner.R

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ context("GraphLearner")
22

33
test_that("basic graphlearner tests", {
44
skip_if_not_installed("rpart")
5-
skip_on_cran() # takes too long
5+
skip_on_cran() # takes too long
66
task = mlr_tasks$get("iris")
77

88
lrn = mlr_learners$get("classif.rpart")
@@ -40,8 +40,8 @@ test_that("basic graphlearner tests", {
4040
expect_true(run_experiment(task, glrn)$ok)
4141
glrn2$train(task)
4242
glrn2_clone$state = glrn2$state
43-
# glrn2_clone$state$log = glrn2_clone$state$log$clone(deep = TRUE) # FIXME: this can go when mlr-org/mlr3#343 is fixed
44-
# glrn2_clone$state$model$classif.rpart$log = glrn2_clone$state$model$classif.rpart$log$clone(deep = TRUE) # FIXME: this can go when mlr-org/mlr3#343 is fixed
43+
# glrn2_clone$state$log = glrn2_clone$state$log$clone(deep = TRUE) # FIXME: this can go when mlr-org/mlr3#343 is fixed
44+
# glrn2_clone$state$model$classif.rpart$log = glrn2_clone$state$model$classif.rpart$log$clone(deep = TRUE) # FIXME: this can go when mlr-org/mlr3#343 is fixed
4545
expect_deep_clone(glrn2_clone, glrn2$clone(deep = TRUE))
4646
expect_prediction_classif({
4747
graphpred2 = glrn2$predict(task)
@@ -109,7 +109,7 @@ test_that("GraphLearner clone_graph FALSE", {
109109
# check that the GraphLearner predicts what we expect
110110
expect_true(isTRUE(all.equal(gl$predict(tsk("iris")), expected_prediction)))
111111

112-
expect_false(gr1$is_trained) # predicting with GraphLearner resets Graph state
112+
expect_false(gr1$is_trained) # predicting with GraphLearner resets Graph state
113113

114114
expect_identical(gl$graph, gr1)
115115

@@ -177,7 +177,7 @@ test_that("graphlearner parameters behave as they should", {
177177

178178
test_that("graphlearner type inference", {
179179
skip_if_not_installed("rpart")
180-
skip_on_cran() # takes too long
180+
skip_on_cran() # takes too long
181181
# default: classif
182182
lrn = GraphLearner$new(mlr_pipeops$get("nop"))
183183
expect_equal(lrn$task_type, "classif")
@@ -246,15 +246,15 @@ test_that("graphlearner type inference", {
246246

247247
test_that("graphlearner type inference - branched", {
248248
skip_if_not_installed("rpart")
249-
skip_on_cran() # takes too long
249+
skip_on_cran() # takes too long
250250

251251
# default: classif
252252

253253
lrn = GraphLearner$new(gunion(list(
254-
mlr_pipeops$get(id = "l1", "learner", lrn("classif.rpart")),
255-
po("nop") %>>% mlr_pipeops$get(id = "l2", "learner", lrn("classif.rpart"))
254+
mlr_pipeops$get(id = "l1", "learner", lrn("classif.rpart")),
255+
po("nop") %>>% mlr_pipeops$get(id = "l2", "learner", lrn("classif.rpart"))
256256

257-
)) %>>%
257+
)) %>>%
258258
po("classifavg") %>>%
259259
po(id = "n2", "nop"))
260260
expect_equal(lrn$task_type, "classif")
@@ -281,9 +281,9 @@ test_that("graphlearner type inference - branched", {
281281

282282
# inference when multiple input, but one is a Task
283283
lrn = GraphLearner$new(gunion(list(
284-
mlr_pipeops$get(id = "l1", "learner", lrn("regr.rpart")),
285-
po("nop") %>>% mlr_pipeops$get(id = "l2", "learner", lrn("regr.rpart"))
286-
)) %>>%
284+
mlr_pipeops$get(id = "l1", "learner", lrn("regr.rpart")),
285+
po("nop") %>>% mlr_pipeops$get(id = "l2", "learner", lrn("regr.rpart"))
286+
)) %>>%
287287
po("regravg") %>>%
288288
po(id = "n2", "nop"))
289289
expect_equal(lrn$task_type, "regr")
@@ -311,7 +311,7 @@ test_that("graphlearner type inference - branched", {
311311

312312
test_that("graphlearner predict type inference", {
313313
skip_if_not_installed("rpart")
314-
skip_on_cran() # takes too long
314+
skip_on_cran() # takes too long
315315
# Getter:
316316

317317
# Classification
@@ -403,9 +403,7 @@ test_that("graphlearner predict type inference", {
403403
expect_equal(lrn$graph$pipeops[[lrr$id]]$predict_type, "prob")
404404

405405
# Errors:
406-
expect_error({
407-
lrrp = po(lrn("classif.featureless", predict_type = "se"))
408-
})
406+
expect_error({lrrp = po(lrn("classif.featureless", predict_type = "se"))})
409407
})
410408

411409

@@ -441,6 +439,7 @@ test_that("GraphLearner model", {
441439

442440
expect_equal(lr$graph_model$pipeops$classif.rpart$learner_model$importance(), imp)
443441

442+
444443
})
445444

446445
test_that("predict() function for Graph", {
@@ -469,6 +468,7 @@ test_that("predict() function for Graph", {
469468
p1$response
470469
)
471470

471+
472472
})
473473

474474
test_that("base_learner() works", {
@@ -558,20 +558,20 @@ test_that("GraphLearner hashes", {
558558
expect_string(all.equal(po("copy", 2)$hash, po("copy", 3)$hash), "mismatch")
559559

560560

561-
lr1 = lrn("classif.rpart")
562-
lr2 = lrn("classif.rpart", fallback = lrn("classif.rpart"))
561+
lr1 <- lrn("classif.rpart")
562+
lr2 <- lrn("classif.rpart", fallback = lrn("classif.rpart"))
563563

564564
expect_string(all.equal(lr1$hash, lr2$hash), "mismatch")
565565
expect_string(all.equal(lr1$phash, lr2$phash), "mismatch")
566566

567-
lr1 = as_learner(as_pipeop(lr1))
568-
lr2 = as_learner(as_pipeop(lr2))
567+
lr1 <- as_learner(as_pipeop(lr1))
568+
lr2 <- as_learner(as_pipeop(lr2))
569569

570570
expect_string(all.equal(lr1$hash, lr2$hash), "mismatch")
571571
expect_string(all.equal(lr1$phash, lr2$phash), "mismatch")
572572

573-
lr1 = as_learner(as_pipeop(lr1))
574-
lr2 = as_learner(as_pipeop(lr2))
573+
lr1 <- as_learner(as_pipeop(lr1))
574+
lr2 <- as_learner(as_pipeop(lr2))
575575

576576
expect_string(all.equal(lr1$hash, lr2$hash), "mismatch")
577577
expect_string(all.equal(lr1$phash, lr2$phash), "mismatch")

0 commit comments

Comments
 (0)