Skip to content

Commit 896cc98

Browse files
committed
fix: anticipate row roles change in mlr3
1 parent 0eb9f48 commit 896cc98

16 files changed

+123
-29
lines changed

.github/workflows/test-task-1.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# r cmd check workflow of the mlr3 ecosystem v0.1.0
2+
# https://github.com/mlr-org/actions
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
name: r-cmd-check-paradox
13+
14+
jobs:
15+
r-cmd-check:
16+
runs-on: ${{ matrix.config.os }}
17+
18+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
19+
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
config:
27+
- {os: ubuntu-latest, r: 'devel'}
28+
- {os: ubuntu-latest, r: 'release'}
29+
30+
steps:
31+
- uses: actions/checkout@v3
32+
33+
- name: mlr3
34+
run: 'echo -e "Remotes:\n mlr-org/mlr3@feat/train-predict" >> DESCRIPTION'
35+
36+
- uses: r-lib/actions/setup-r@v2
37+
with:
38+
r-version: ${{ matrix.config.r }}
39+
40+
- uses: r-lib/actions/setup-r-dependencies@v2
41+
with:
42+
extra-packages: any::rcmdcheck
43+
needs: check
44+
- uses: r-lib/actions/check-r-package@v2

.github/workflows/test-task-2.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# r cmd check workflow of the mlr3 ecosystem v0.1.0
2+
# https://github.com/mlr-org/actions
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
name: r-cmd-check-paradox
13+
14+
jobs:
15+
r-cmd-check:
16+
runs-on: ${{ matrix.config.os }}
17+
18+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
19+
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
config:
27+
- {os: ubuntu-latest, r: 'devel'}
28+
- {os: ubuntu-latest, r: 'release'}
29+
30+
steps:
31+
- uses: actions/checkout@v3
32+
33+
- name: mlr3
34+
run: 'echo -e "Remotes:\n mlr-org/mlr3@feat/train-predict" >> DESCRIPTION'
35+
36+
- name: mlr3pipelines
37+
run: 'echo -e "Remotes:\n mlr-org/mlr3pipelines@feat/test-rows" >> DESCRIPTION'
38+
39+
- uses: r-lib/actions/setup-r@v2
40+
with:
41+
r-version: ${{ matrix.config.r }}
42+
43+
- uses: r-lib/actions/setup-r-dependencies@v2
44+
with:
45+
extra-packages: any::rcmdcheck
46+
needs: check
47+
- uses: r-lib/actions/check-r-package@v2

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Config/testthat/parallel: true
5252
Encoding: UTF-8
5353
NeedsCompilation: no
5454
Roxygen: list(markdown = TRUE)
55-
RoxygenNote: 7.2.3
55+
RoxygenNote: 7.3.1
5656
Collate:
5757
'ArchiveTuning.R'
5858
'AutoTuner.R'

NAMESPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,10 @@ import(mlr3)
4747
import(mlr3misc)
4848
import(paradox)
4949
importFrom(R6,R6Class)
50+
importFrom(bbotk,mlr_terminators)
51+
importFrom(bbotk,trm)
52+
importFrom(bbotk,trms)
53+
importFrom(mlr3misc,clbk)
54+
importFrom(mlr3misc,clbks)
55+
importFrom(mlr3misc,mlr_callbacks)
5056
importFrom(utils,bibentry)

R/TunerIrace.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ target_runner_tuning = function(experiment, exec.target.runner, scenario, target
138138
configuration
139139
})
140140
# fix logicals
141-
lgl_params = as.data.table(tuning_instance$search_space)[class == "ParamLgl", id]
141+
lgl_params = as.data.table(tuning_instance$search_space)[class == "ParamLgl", get("id")]
142142
if (length(lgl_params)) xdt[, (lgl_params) := lapply(.SD, as.logical), .SDcols = lgl_params]
143143

144144
# provide experiment instances to objective

R/mlr_callbacks.R

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,9 @@ load_callback_backup = function() {
151151
#' callbacks = clbk("mlr3tuning.measures", measures = msr("classif.acc"))
152152
#' )
153153
#'
154-
#' # score the configurations on the holdout set
155154
#' task = tsk("pima")
156-
#' splits = partition(task, ratio = 0.8)
157-
#' task$row_roles$use = splits$train
158-
#' task$row_roles$holdout = splits$test
159155
#'
160156
#' learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE))
161-
#' learner$predict_sets = c("test", "holdout")
162157
#'
163158
#' instance = tune(
164159
#' tuner = tnr("random_search", batch_size = 2),
@@ -168,7 +163,7 @@ load_callback_backup = function() {
168163
#' measures = msr("classif.ce"),
169164
#' term_evals = 4,
170165
#' callbacks = clbk("mlr3tuning.measures", measures = msr("classif.ce",
171-
#' predict_sets = "holdout", id = "classif.ce_holdout"))
166+
#' predict_sets = "test", id = "classif.ce_holdout"))
172167
#' )
173168
NULL
174169

inst/testthat/helper_misc.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,9 @@ MAKE_GL = function() {
139139
g$add_pipeop(op_ds)
140140
g$add_pipeop(op_lrn)
141141
g$add_edge("subsample", "classif.rpart")
142-
GraphLearner$new(g)
142+
gl = GraphLearner$new(g)
143+
# FIXME: this is needed because graphlearner sets its properties to all available properties,
144+
# which will be fixed in the next pipelines release
145+
gl$properties = setdiff(gl$properties, "uses_test_task")
146+
gl
143147
}

man/mlr3tuning.measures.Rd

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/mlr_tuners_cmaes.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/mlr_tuners_design_points.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)