diff --git a/.github/workflows/r-cmd-check-paradox.yml b/.github/workflows/r-cmd-check-paradox.yml new file mode 100644 index 0000000..44327d4 --- /dev/null +++ b/.github/workflows/r-cmd-check-paradox.yml @@ -0,0 +1,44 @@ +# r cmd check workflow of the mlr3 ecosystem v0.1.0 +# https://github.com/mlr-org/actions +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main + +name: r-cmd-check-paradox + +jobs: + r-cmd-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + strategy: + fail-fast: false + matrix: + config: + - {os: ubuntu-latest, r: 'devel'} + - {os: ubuntu-latest, r: 'release'} + + steps: + - uses: actions/checkout@v3 + + - name: paradox + run: 'echo -e "Remotes:\n mlr-org/paradox,\n mlr-org/mlr3learners,\n mlr-org/mlr3pipelines,\n mlr-org/mlr3oml" >> DESCRIPTION' + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + - uses: r-lib/actions/check-r-package@v2 diff --git a/NEWS.md b/NEWS.md index 4f2d60d..21da7d8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # mcboost (development version) +* Compatibility with upcoming 'paradox' release. + # mcboost 0.4.2 * Removed new functionality for survival tasks added in `0.4.0`. A dependency, `mlr3proba` was removed from CRAN for now. diff --git a/R/PipeOpMCBoost.R b/R/PipeOpMCBoost.R index 9cc8a7d..6ff5095 100644 --- a/R/PipeOpMCBoost.R +++ b/R/PipeOpMCBoost.R @@ -65,19 +65,19 @@ PipeOpMCBoost = R6Class("PipeOpMCBoost", #' @param param_vals [`list`] \cr #' List of hyperparameters for the `PipeOp`. initialize = function(id = "mcboost", param_vals = list()) { - param_set = paradox::ParamSet$new(list( - paradox::ParamInt$new("max_iter", lower = 0L, upper = Inf, default = 5L, tags = "train"), - paradox::ParamDbl$new("alpha", lower = 0, upper = 1, default = 1e-4, tags = "train"), - paradox::ParamDbl$new("eta", lower = 0, upper = 1, default = 1, tags = "train"), - paradox::ParamLgl$new("partition", tags = "train", default = TRUE), - paradox::ParamInt$new("num_buckets", lower = 1, upper = Inf, default = 2L, tags = "train"), - paradox::ParamLgl$new("rebucket", default = FALSE, tags = "train"), - paradox::ParamLgl$new("multiplicative", default = TRUE, tags = "train"), - paradox::ParamUty$new("auditor_fitter", default = NULL, tags = "train"), - paradox::ParamUty$new("subpops", default = NULL, tags = "train"), - paradox::ParamUty$new("default_model_class", default = ConstantPredictor, tags = "train"), - paradox::ParamUty$new("init_predictor", default = NULL, tags = "train") - )) + param_set = paradox::ps( + max_iter = paradox::p_int(lower = 0L, upper = Inf, default = 5L, tags = "train"), + alpha = paradox::p_dbl(lower = 0, upper = 1, default = 1e-4, tags = "train"), + eta = paradox::p_dbl(lower = 0, upper = 1, default = 1, tags = "train"), + partition = paradox::p_lgl(tags = "train", default = TRUE), + num_buckets = paradox::p_int(lower = 1, upper = Inf, default = 2L, tags = "train"), + rebucket = paradox::p_lgl(default = FALSE, tags = "train"), + multiplicative = paradox::p_lgl(default = TRUE, tags = "train"), + auditor_fitter = paradox::p_uty(default = NULL, tags = "train"), + subpops = paradox::p_uty(default = NULL, tags = "train"), + default_model_class = paradox::p_uty(default = ConstantPredictor, tags = "train"), + init_predictor = paradox::p_uty(default = NULL, tags = "train") + ) super$initialize(id, param_set = param_set, param_vals = param_vals, packages = character(0), input = data.table(name = c("data", "prediction"), train = c("TaskClassif", "TaskClassif"), predict = c("TaskClassif", "TaskClassif")),