Skip to content

Commit 7eccb17

Browse files
sebffischermb706
andauthored
paradox compatability, remove holdout rows
* check with new paradox * new paradox syntax * paradox:: * update vignette to not use holdout role * add workflows * fix workflow * trigger actions * dev cmd check with paradox master * news * Update vignettes/mcboost_basics_extensions.Rmd * delete workflows * paradox compatibility, vignette * update maintainer * release 0.4.3 --------- Co-authored-by: mb706 <mlr.developer@mb706.com>
1 parent 8ac638b commit 7eccb17

File tree

7 files changed

+88
-56
lines changed

7 files changed

+88
-56
lines changed
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: paradox
34+
run: 'echo -e "Remotes:\n mlr-org/paradox,\n mlr-org/mlr3learners,\n mlr-org/mlr3pipelines,\n mlr-org/mlr3oml" >> 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

DESCRIPTION

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: mcboost
22
Type: Package
33
Title: Multi-Calibration Boosting
4-
Version: 0.4.2
4+
Version: 0.4.3
55
Authors@R:
66
c(person(given = "Florian",
77
family = "Pfisterer",
8-
role = c("cre", "aut"),
8+
role = "aut",
99
email = "pfistererf@googlemail.com",
1010
comment = c(ORCID = "0000-0001-8867-762X")),
1111
person(given = "Susanne",
@@ -18,18 +18,21 @@ Authors@R:
1818
role = "ctb",
1919
email = "c.kern@uni-mannheim.de",
2020
comment = c(ORCID = "0000-0001-7363-4299")),
21-
person(given = "Carolin",
21+
person(given = "Carolin",
2222
family = "Becker",
2323
role = "ctb"),
2424
person(given = "Bernd",
2525
family = "Bischl",
2626
role = "ctb",
2727
email = "bernd_bischl@gmx.net",
28-
comment = c(ORCID = "0000-0001-6002-6980"))
28+
comment = c(ORCID = "0000-0001-6002-6980")),
29+
person(given = "Sebastian",
30+
family = "Fischer",
31+
role = c("ctb", "cre"),
32+
email = "sebf.fischer@gmail.com")
2933
)
30-
Maintainer: Florian Pfisterer <pfistererf@googlemail.com>
3134
Description: Implements 'Multi-Calibration Boosting' (2018) <https://proceedings.mlr.press/v80/hebert-johnson18a.html> and
32-
'Multi-Accuracy Boosting' (2019) <arXiv:1805.12317> for the multi-calibration of a machine learning model's prediction.
35+
'Multi-Accuracy Boosting' (2019) <doi:10.48550/arXiv.1805.12317> for the multi-calibration of a machine learning model's prediction.
3336
'MCBoost' updates predictions for sub-groups in an iterative fashion in order to mitigate biases like poor calibration or large accuracy differences across subgroups.
3437
Multi-Calibration works best in scenarios where the underlying data & labels are unbiased, but resulting models are.
3538
This is often the case, e.g. when an algorithm fits a majority population while ignoring or under-fitting minority populations.
@@ -66,9 +69,9 @@ Suggests:
6669
covr,
6770
testthat (>= 3.1.0)
6871
Roxygen: list(markdown = TRUE, r6 = TRUE)
69-
RoxygenNote: 7.2.1
72+
RoxygenNote: 7.3.1
7073
VignetteBuilder: knitr
71-
Collate:
74+
Collate:
7275
'AuditorFitters.R'
7376
'MCBoost.R'
7477
'PipelineMCBoost.R'

NEWS.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# mcboost (development version)
1+
# mcboost 0.4.3
2+
3+
* Compatibility with upcoming 'paradox' release.
4+
* Change the vignette to not use the holdout task.
25

36
# mcboost 0.4.2
4-
* Removed new functionality for survival tasks added in `0.4.0`.
7+
* Removed new functionality for survival tasks added in `0.4.0`.
58
A dependency, `mlr3proba` was removed from CRAN for now.
69
The functionality will be added back when `mlr3proba` is re-introduced to CRAN.
710
Users who wish to use `mcboost` for `survival` are adviced to use version `0.4.1` usetogether with the GitHub version of `mlr3proba`.

R/PipeOpMCBoost.R

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ PipeOpMCBoost = R6Class("PipeOpMCBoost",
6565
#' @param param_vals [`list`] \cr
6666
#' List of hyperparameters for the `PipeOp`.
6767
initialize = function(id = "mcboost", param_vals = list()) {
68-
param_set = paradox::ParamSet$new(list(
69-
paradox::ParamInt$new("max_iter", lower = 0L, upper = Inf, default = 5L, tags = "train"),
70-
paradox::ParamDbl$new("alpha", lower = 0, upper = 1, default = 1e-4, tags = "train"),
71-
paradox::ParamDbl$new("eta", lower = 0, upper = 1, default = 1, tags = "train"),
72-
paradox::ParamLgl$new("partition", tags = "train", default = TRUE),
73-
paradox::ParamInt$new("num_buckets", lower = 1, upper = Inf, default = 2L, tags = "train"),
74-
paradox::ParamLgl$new("rebucket", default = FALSE, tags = "train"),
75-
paradox::ParamLgl$new("multiplicative", default = TRUE, tags = "train"),
76-
paradox::ParamUty$new("auditor_fitter", default = NULL, tags = "train"),
77-
paradox::ParamUty$new("subpops", default = NULL, tags = "train"),
78-
paradox::ParamUty$new("default_model_class", default = ConstantPredictor, tags = "train"),
79-
paradox::ParamUty$new("init_predictor", default = NULL, tags = "train")
80-
))
68+
param_set = paradox::ps(
69+
max_iter = paradox::p_int(lower = 0L, upper = Inf, default = 5L, tags = "train"),
70+
alpha = paradox::p_dbl(lower = 0, upper = 1, default = 1e-4, tags = "train"),
71+
eta = paradox::p_dbl(lower = 0, upper = 1, default = 1, tags = "train"),
72+
partition = paradox::p_lgl(tags = "train", default = TRUE),
73+
num_buckets = paradox::p_int(lower = 1, upper = Inf, default = 2L, tags = "train"),
74+
rebucket = paradox::p_lgl(default = FALSE, tags = "train"),
75+
multiplicative = paradox::p_lgl(default = TRUE, tags = "train"),
76+
auditor_fitter = paradox::p_uty(default = NULL, tags = "train"),
77+
subpops = paradox::p_uty(default = NULL, tags = "train"),
78+
default_model_class = paradox::p_uty(default = ConstantPredictor, tags = "train"),
79+
init_predictor = paradox::p_uty(default = NULL, tags = "train")
80+
)
8181
super$initialize(id,
8282
param_set = param_set, param_vals = param_vals, packages = character(0),
8383
input = data.table(name = c("data", "prediction"), train = c("TaskClassif", "TaskClassif"), predict = c("TaskClassif", "TaskClassif")),

cran-comments.md

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
1-
## Reason for resubmission
2-
3-
Removed dependency on package mlr3proba that was removed from CRAN.
4-
Apologies for not being able to upload a new version in time.
5-
61
## R CMD check
72

8-
Results in one NOTE:
9-
10-
CRAN repository db overrides:
11-
X-CRAN-Comment: Archived on 2022-05-16 as requires archived package 'mlr3proba'.
12-
13-
The dependency on 'mlr3proba' has been removed in the updated version.
14-
15-
16-
There is one NOTE that is only found on Windows (Server 2022, R-devel 64-bit):
17-
18-
```
19-
* checking for detritus in the temp directory ... NOTE
20-
Found the following files/directories:
21-
'lastMiKTeXException'
22-
```
23-
24-
As noted in R-hub issue #503, this could be due to a bug/crash in MiKTeX and can likely be ignored.
25-
26-
- WARNINGs or ERRORs
27-
28-
## R-HUB
3+
0 errors | 0 warnings | 1 note
294

30-
All checks show "Status: success"
5+
New maintainer:
6+
Sebastian Fischer <sebf.fischer@gmail.com>

man/mcboost-package.Rd

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

vignettes/mcboost_basics_extensions.Rmd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,11 @@ summary(data$ViolentCrimesPerPop)
517517
```
518518

519519
We again split our task into **train** and **test**.
520-
We do this in `mlr3` by simply setting some (here 500) row roles to `"holdout"`.
520+
We do this in `mlr3` by creating a 2/3 - 1/3 split using `mlr3::partition()` and assigning the train ids to the row role `"use"`.
521521

522522
```{r}
523-
tsk$set_row_roles(sample(tsk$row_roles$use, 500), "holdout")
523+
split = partition(tsk)
524+
tsk$set_row_roles(split$train, "use")
524525
```
525526

526527
### 6.1 Preprocessing
@@ -571,13 +572,13 @@ mc$multicalibrate(data, labels)
571572

572573
### 6.3 Evaluation on Test Data
573574

574-
We first create the test task by setting the `holdout` rows to `use`, and then
575+
We first create the test task by assigning the test ids to the row role `"use"`, and then
575576
use our preprocessing `pipe's` predict function to also impute missing values
576577
for the validation data. Then we again extract features `X` and target `y`.
577578

578579
```{r}
579580
test_task = tsk$clone()
580-
test_task$row_roles$use = test_task$row_roles$holdout
581+
test_task$row_roles$use = split$test
581582
test_task = pipe$predict(list(test_task))[[1]]
582583
test_data = test_task$data(cols = tsk$feature_names)
583584
test_labels = test_task$data(cols = tsk$target_names)[[1]]

0 commit comments

Comments
 (0)