Skip to content

Commit dcdc081

Browse files
committed
upkeep with mlr3
1 parent 46dbeaf commit dcdc081

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

R/GraphLearner.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ GraphLearner = R6Class("GraphLearner", inherit = Learner,
272272
if (!some_pipeops_validate) {
273273
lg$warn("GraphLearner '%s' specifies a validation set, but none of its Learners use it.", self$id)
274274
}
275+
} else {
276+
# otherwise the pipeops will preprocess this unnecessarily
277+
if (!is.null(task$internal_valid_task)) {
278+
prev_itv = task$internal_valid_task
279+
on.exit({task$internal_valid_task = prev_itv}, add = TRUE)
280+
task$internal_valid_task = NULL
281+
}
275282
}
276283

277284
on.exit({self$graph$state = NULL})

R/pipeline_branch.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,9 @@ 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-

0 commit comments

Comments
 (0)