Skip to content

Commit c65f752

Browse files
committed
Merge branch 'master' into feat/inner_valid
2 parents d82f305 + 11b8193 commit c65f752

20 files changed

+77
-88
lines changed

.github/workflows/pkgdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Deploy
4646
if: github.event_name != 'pull_request'
47-
uses: JamesIves/github-pages-deploy-action@v4.5.0
47+
uses: JamesIves/github-pages-deploy-action@v4.6.1
4848
with:
4949
clean: false
5050
branch: gh-pages

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Config/testthat/edition: 3
9696
Config/testthat/parallel: true
9797
NeedsCompilation: no
9898
Roxygen: list(markdown = TRUE, r6 = FALSE)
99-
RoxygenNote: 7.3.1
99+
RoxygenNote: 7.3.2
100100
VignetteBuilder: knitr
101101
Collate:
102102
'Graph.R'

NEWS.md

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

3+
4+
* Compatibility with new `bbotk` release.
35
* Added marshaling support to `GraphLearner`
46
* Support internal tuning and validation
57

R/LearnerAvg.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#' * `optimizer` :: [`Optimizer`][bbotk::Optimizer] | `character(1)`\cr
3333
#' [`Optimizer`][bbotk::Optimizer] used to find optimal thresholds.
3434
#' If `character`, converts to [`Optimizer`][bbotk::Optimizer]
35-
#' via [`opt`][bbotk::opt]. Initialized to [`OptimizerNLoptr`][bbotk::OptimizerNLoptr].
35+
#' via [`opt`][bbotk::opt]. Initialized to `OptimizerNLoptr`.
3636
#' Nloptr hyperparameters are initialized to `xtol_rel = 1e-8`, `algorithm = "NLOPT_LN_COBYLA"`
3737
#' and equal initial weights for each learner.
3838
#' For more fine-grained control, it is recommended to supply a instantiated [`Optimizer`][bbotk::Optimizer].
@@ -191,7 +191,7 @@ optimize_weights_learneravg = function(self, task, n_weights, data) {
191191
optimizer = pars$optimizer
192192
if (inherits(optimizer, "character")) {
193193
optimizer = bbotk::opt(optimizer)
194-
if (inherits(optimizer, "OptimizerNLoptr")) {
194+
if (inherits(optimizer, "OptimizerNLoptr") || inherits(optimizer, "OptimizerBatchNLoptr")) {
195195
optimizer$param_set$values = list(xtol_rel = 1e-8, algorithm = "NLOPT_LN_COBYLA", start_values = "center")
196196
}
197197
}

R/PipeOp.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ PipeOp = R6Class("PipeOp",
310310
warning(w)
311311
invokeRestart("muffleWarning")
312312
})
313+
if (!is.null(self$state) && !is.null(private$.state_class)) {
314+
class(self$state) = c(private$.state_class, class(self$state))
315+
}
316+
313317
output = check_types(self, output, "output", "train")
314318
on.exit() # don't reset state any more
315319
output
@@ -431,6 +435,7 @@ PipeOp = R6Class("PipeOp",
431435
),
432436

433437
private = list(
438+
.state_class = NULL,
434439
deep_clone = function(name, value) {
435440
if (!is.null(private$.param_set_source)) {
436441
private$.param_set = NULL # required to keep clone identical to original, otherwise tests get really ugly

R/PipeOpImputeLearner.R

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,6 @@ PipeOpImputeLearner = R6Class("PipeOpImputeLearner",
118118
)
119119
super$initialize(id, param_set = alist(private$.learner$param_set), param_vals = param_vals,
120120
whole_task_dependent = TRUE, feature_types = feature_types)
121-
},
122-
train = function(inputs) {
123-
outputs = super$train(inputs)
124-
self$state = multiplicity_recurse(self$state, function(state) {
125-
structure(state, class = c("pipeop_impute_learner_state", class(state)))
126-
})
127-
return(outputs)
128121
}
129122
),
130123
active = list(
@@ -151,6 +144,7 @@ PipeOpImputeLearner = R6Class("PipeOpImputeLearner",
151144
),
152145
private = list(
153146
.learner = NULL,
147+
.state_class = "pipeop_impute_learner_state",
154148

155149
.train_imputer = function(feature, type, context) {
156150
on.exit({private$.learner$state = NULL})

R/PipeOpLearner.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ PipeOpLearner = R6Class("PipeOpLearner", inherit = PipeOp,
112112
super$initialize(id, param_set = alist(private$.learner$param_set), param_vals = param_vals,
113113
input = data.table(name = "input", train = task_type, predict = task_type),
114114
output = data.table(name = "output", train = "NULL", predict = out_type),
115-
tags = "learner", packages = learner$packages, properties = properties)
115+
tags = "learner", packages = learner$packages, properties = properties
116+
)
116117
}
117118
),
118119
active = list(

R/PipeOpLearnerCV.R

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,8 @@ PipeOpLearnerCV = R6Class("PipeOpLearnerCV",
146146
# private$.crossval_param_set$add_dep("folds", "method", CondEqual$new("cv")) # don't do this.
147147

148148
super$initialize(id, alist(resampling = private$.crossval_param_set, private$.learner$param_set), param_vals = param_vals, can_subset_cols = TRUE, task_type = task_type, tags = c("learner", "ensemble"))
149-
},
150-
train = function(inputs) {
151-
outputs = super$train(inputs)
152-
self$state = multiplicity_recurse(self$state, function(state) {
153-
structure(state, class = c("pipeop_learner_cv_state", class(state)))
154-
})
155-
return(outputs)
156149
}
150+
157151
),
158152
active = list(
159153
learner = function(val) {
@@ -185,6 +179,7 @@ PipeOpLearnerCV = R6Class("PipeOpLearnerCV",
185179
}
186180
),
187181
private = list(
182+
.state_class = "pipeop_learner_cv_state",
188183
.train_task = function(task) {
189184
on.exit({private$.learner$state = NULL})
190185

R/PipeOpTaskPreproc.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ PipeOpTaskPreproc = R6Class("PipeOpTaskPreproc",
187187
super$initialize(id = id, param_set = param_set, param_vals = param_vals,
188188
input = data.table(name = "input", train = task_type, predict = task_type),
189189
output = data.table(name = "output", train = task_type, predict = task_type),
190-
packages = packages, tags = c(tags, "data transform"))
190+
packages = packages, tags = c(tags, "data transform")
191+
)
191192
}
192193
),
193194
active = list(

0 commit comments

Comments
 (0)