From 26376c3f63f06253349c95437f0be07d57317c98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:50:04 +0100 Subject: [PATCH 1/7] chore(deps): bump JamesIves/github-pages-deploy-action (#1205) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.8 to 4.6.9. - [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases) - [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.6.8...v4.6.9) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pkgdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 7aec5da57..0e935d7f2 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -44,7 +44,7 @@ jobs: - name: Deploy if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.6.8 + uses: JamesIves/github-pages-deploy-action@v4.6.9 with: clean: false branch: gh-pages From 7c3c74b614c4c943f61e2e03992ee26b1e177605 Mon Sep 17 00:00:00 2001 From: Marc Becker <33069354+be-marc@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:59:36 +0100 Subject: [PATCH 2/7] BREAKING CHANGE: remove $loglik method from all learners (#1207) --- NEWS.md | 1 + R/Learner.R | 3 --- R/MeasureAIC.R | 12 +++++++----- R/MeasureBIC.R | 10 ++++++---- R/mlr_reflections.R | 2 +- man/Learner.Rd | 2 -- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/NEWS.md b/NEWS.md index 7b3909adb..8c9054232 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ * fix: Quantiles must not ascend with probabilities. * refactor: Replace `tsk("boston_housing")` with `tsk("california_housing")`. +* BREAKING CHANGE: Remove ``$loglik()`` method from all learners. # mlr3 0.21.1 diff --git a/R/Learner.R b/R/Learner.R index 213c7855a..72014c8f5 100644 --- a/R/Learner.R +++ b/R/Learner.R @@ -59,9 +59,6 @@ #' * `oob_error(...)`: Returns the out-of-bag error of the model as `numeric(1)`. #' The learner must be tagged with property `"oob_error"`. #' -#' * `loglik(...)`: Extracts the log-likelihood (c.f. [stats::logLik()]). -#' This can be used in measures like [mlr_measures_aic] or [mlr_measures_bic]. -#' #' * `internal_valid_scores`: Returns the internal validation score(s) of the model as a named `list()`. #' Only available for [`Learner`]s with the `"validation"` property. #' If the learner is not trained yet, this returns `NULL`. diff --git a/R/MeasureAIC.R b/R/MeasureAIC.R index 5a0203d1d..e0a988ebc 100644 --- a/R/MeasureAIC.R +++ b/R/MeasureAIC.R @@ -40,12 +40,14 @@ MeasureAIC = R6Class("MeasureAIC", private = list( .score = function(prediction, learner, ...) { learner = learner$base_learner() - if ("loglik" %nin% learner$properties) { - return(NA_real_) - } - k = self$param_set$values$k %??% 2 - return(stats::AIC(learner$loglik(), k = k)) + + tryCatch({ + return(stats::AIC(stats::logLik(learner$model), k = k)) + }, error = function(e) { + warningf("Learner '%s' does not support AIC calculation", learner$id) + return(NA_real_) + }) } ) ) diff --git a/R/MeasureBIC.R b/R/MeasureBIC.R index 94d67d515..b3d48f205 100644 --- a/R/MeasureBIC.R +++ b/R/MeasureBIC.R @@ -38,11 +38,13 @@ MeasureBIC = R6Class("MeasureBIC", private = list( .score = function(prediction, learner, ...) { learner = learner$base_learner() - if ("loglik" %nin% learner$properties) { - return(NA_real_) - } - return(stats::BIC(learner$loglik())) + tryCatch({ + return(stats::BIC(stats::logLik(learner$model))) + }, error = function(e) { + warningf("Learner '%s' does not support BIC calculation", learner$id) + return(NA_real_) + }) } ) ) diff --git a/R/mlr_reflections.R b/R/mlr_reflections.R index e1111dc16..283562658 100644 --- a/R/mlr_reflections.R +++ b/R/mlr_reflections.R @@ -118,7 +118,7 @@ local({ ) ### Learner - tmp = c("featureless", "missings", "weights", "importance", "selected_features", "oob_error", "loglik", "hotstart_forward", "hotstart_backward", "validation", "internal_tuning", "marshal") + tmp = c("featureless", "missings", "weights", "importance", "selected_features", "oob_error", "hotstart_forward", "hotstart_backward", "validation", "internal_tuning", "marshal") mlr_reflections$learner_properties = list( classif = c(tmp, "twoclass", "multiclass"), regr = tmp diff --git a/man/Learner.Rd b/man/Learner.Rd index 8f3aacaeb..fee67c15a 100644 --- a/man/Learner.Rd +++ b/man/Learner.Rd @@ -46,8 +46,6 @@ To filter variables using the importance scores, see package \CRANpkg{mlr3filter The learner must be tagged with property \code{"selected_features"}. \item \code{oob_error(...)}: Returns the out-of-bag error of the model as \code{numeric(1)}. The learner must be tagged with property \code{"oob_error"}. -\item \code{loglik(...)}: Extracts the log-likelihood (c.f. \code{\link[stats:logLik]{stats::logLik()}}). -This can be used in measures like \link{mlr_measures_aic} or \link{mlr_measures_bic}. \item \code{internal_valid_scores}: Returns the internal validation score(s) of the model as a named \code{list()}. Only available for \code{\link{Learner}}s with the \code{"validation"} property. If the learner is not trained yet, this returns \code{NULL}. From f89dff8457d3a6cd6800c4ce937d76de11e5aab6 Mon Sep 17 00:00:00 2001 From: Marc Becker <33069354+be-marc@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:36:54 +0100 Subject: [PATCH 3/7] fix: ignore size of globals when sequential future plan is used (#1209) * fix: ignore size of globals when sequential future plan is used * ... --- NEWS.md | 1 + R/helper_exec.R | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/NEWS.md b/NEWS.md index 8c9054232..953d87a62 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ * fix: Quantiles must not ascend with probabilities. * refactor: Replace `tsk("boston_housing")` with `tsk("california_housing")`. * BREAKING CHANGE: Remove ``$loglik()`` method from all learners. +* fix: Ignore `future.globals.maxSize` when `future::plan("sequential")` is used. # mlr3 0.21.1 diff --git a/R/helper_exec.R b/R/helper_exec.R index 2ca51bf58..c59c0d1eb 100644 --- a/R/helper_exec.R +++ b/R/helper_exec.R @@ -30,6 +30,13 @@ future_map = function(n, FUN, ..., MoreArgs = list()) { } stdout = if (is_sequential) NA else TRUE + # workaround for sequential plan checking the size of the globals + # see https://github.com/futureverse/future/issues/197 + if (is_sequential) { + old_opts = options(future.globals.maxSize = Inf) + on.exit(options(old_opts), add = TRUE) + } + MoreArgs = c(MoreArgs, list(is_sequential = is_sequential)) lg$debug("Running resample() via future with %i iterations", n) From b95228a913fb39864eaa9912577b9df28573aeab Mon Sep 17 00:00:00 2001 From: Marc Becker <33069354+be-marc@users.noreply.github.com> Date: Wed, 20 Nov 2024 08:21:44 +0100 Subject: [PATCH 4/7] feat: add characteristics field to task (#1211) * feat: add characteristics field to task * ... --- NEWS.md | 1 + R/BenchmarkResult.R | 14 +++++++-- R/Task.R | 16 ++++++++++ R/helper_hashes.R | 3 +- man/BenchmarkResult.Rd | 2 +- man/Task.Rd | 3 ++ tests/testthat/test_Task.R | 61 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 95 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 953d87a62..95136851c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ * refactor: Replace `tsk("boston_housing")` with `tsk("california_housing")`. * BREAKING CHANGE: Remove ``$loglik()`` method from all learners. * fix: Ignore `future.globals.maxSize` when `future::plan("sequential")` is used. +* feat: Add `$characteristics` field to `Task` to store additional information. # mlr3 0.21.1 diff --git a/R/BenchmarkResult.R b/R/BenchmarkResult.R index 72c7d8c3f..97cc4c94d 100644 --- a/R/BenchmarkResult.R +++ b/R/BenchmarkResult.R @@ -19,7 +19,7 @@ #' @template param_measures #' #' @section S3 Methods: -#' * `as.data.table(rr, ..., reassemble_learners = TRUE, convert_predictions = TRUE, predict_sets = "test")`\cr +#' * `as.data.table(rr, ..., reassemble_learners = TRUE, convert_predictions = TRUE, predict_sets = "test", task_characteristics = FALSE)`\cr #' [BenchmarkResult] -> [data.table::data.table()]\cr #' Returns a tabular view of the internal data. #' * `c(...)`\cr @@ -545,9 +545,17 @@ BenchmarkResult = R6Class("BenchmarkResult", ) #' @export -as.data.table.BenchmarkResult = function(x, ..., hashes = FALSE, predict_sets = "test") { # nolint +as.data.table.BenchmarkResult = function(x, ..., hashes = FALSE, predict_sets = "test", task_characteristics = FALSE) { # nolint + assert_flag(task_characteristics) tab = get_private(x)$.data$as_data_table(view = NULL, predict_sets = predict_sets) - tab[, c("uhash", "task", "learner", "resampling", "iteration", "prediction"), with = FALSE] + tab = tab[, c("uhash", "task", "learner", "resampling", "iteration", "prediction"), with = FALSE] + + if (task_characteristics) { + tab[, characteristics := map(task, "characteristics")] + tab = unnest(tab, "characteristics") + } + + tab[] } #' @export diff --git a/R/Task.R b/R/Task.R index 383ab7df8..12fa909ee 100644 --- a/R/Task.R +++ b/R/Task.R @@ -253,6 +253,10 @@ Task = R6Class("Task", if (!is.null(private$.internal_valid_task)) { catf(str_indent("* Validation Task:", sprintf("(%ix%i)", private$.internal_valid_task$nrow, private$.internal_valid_task$ncol))) } + + if (!is.null(self$characteristics)) { + catf(str_indent("* Characteristics: ", as_short_string(self$characteristics))) + } }, #' @description @@ -1117,6 +1121,17 @@ Task = R6Class("Task", private$.col_hashes = self$backend$col_hashes[setdiff(unlist(private$.col_roles, use.names = FALSE), self$backend$primary_key)] } private$.col_hashes + }, + + #' @field characteristics (`list()`)\cr + #' List of characteristics of the task, e.g. `list(n = 5, p = 7)`. + characteristics = function(rhs) { + if (missing(rhs)) { + return(private$.characteristics) + } + + private$.characteristics = assert_list(rhs, null.ok = TRUE) + private$.hash = NULL } ), @@ -1128,6 +1143,7 @@ Task = R6Class("Task", .row_roles = NULL, .hash = NULL, .col_hashes = NULL, + .characteristics = NULL, deep_clone = function(name, value) { # NB: DataBackends are never copied! diff --git a/R/helper_hashes.R b/R/helper_hashes.R index 6fff3e4fe..211264f28 100644 --- a/R/helper_hashes.R +++ b/R/helper_hashes.R @@ -48,5 +48,6 @@ task_hash = function(task, use_ids, test_ids = NULL, ignore_internal_valid_task use_ids, task$col_roles, get_private(task)$.properties, - internal_valid_task_hash) + internal_valid_task_hash, + task$characteristics) } diff --git a/man/BenchmarkResult.Rd b/man/BenchmarkResult.Rd index 630cb02d7..0e1f18d9a 100644 --- a/man/BenchmarkResult.Rd +++ b/man/BenchmarkResult.Rd @@ -20,7 +20,7 @@ Do not modify any extracted object without cloning it first. \section{S3 Methods}{ \itemize{ -\item \code{as.data.table(rr, ..., reassemble_learners = TRUE, convert_predictions = TRUE, predict_sets = "test")}\cr +\item \code{as.data.table(rr, ..., reassemble_learners = TRUE, convert_predictions = TRUE, predict_sets = "test", task_characteristics = FALSE)}\cr \link{BenchmarkResult} -> \code{\link[data.table:data.table]{data.table::data.table()}}\cr Returns a tabular view of the internal data. \item \code{c(...)}\cr diff --git a/man/Task.Rd b/man/Task.Rd index 8e327a90a..f45a41ddc 100644 --- a/man/Task.Rd +++ b/man/Task.Rd @@ -147,6 +147,9 @@ Required for \code{\link[=convert_task]{convert_task()}}.} \item{\code{mlr3_version}}{(\code{package_version})\cr Package version of \code{mlr3} used to create the task.} + +\item{\code{characteristics}}{(\code{list()})\cr +List of characteristics of the task, e.g. \code{list(n = 5, p = 7)}.} } \if{html}{\out{}} } diff --git a/tests/testthat/test_Task.R b/tests/testthat/test_Task.R index 35ffadfc5..442caeefa 100644 --- a/tests/testthat/test_Task.R +++ b/tests/testthat/test_Task.R @@ -669,3 +669,64 @@ test_that("$select changes hash", { h2 = task$hash expect_false(h1 == h2) }) + +test_that("$characteristics works", { + task = tsk("spam") + characteristics = list(foo = 1, bar = "a") + task$characteristics = characteristics + + expect_snapshot(task) + expect_equal(task$characteristics, characteristics) + + tsk_1 = tsk("spam") + tsk_1$characteristics = list(n = 300) + tsk_2 = tsk("spam") + tsk_2$characteristics = list(n = 200) + + expect_true(tsk_1$hash != tsk_2$hash) + + learner = lrn("classif.rpart") + resampling = rsmp("cv", folds = 3) + + design = benchmark_grid( + task = list(tsk_1, tsk_2), + learner = learner, + resampling = resampling + ) + + bmr = benchmark(design) + tab = as.data.table(bmr, task_characteristics = TRUE) + expect_names(names(tab), must.include = "n") + expect_subset(tab$n, c(300, 200)) + + tsk_1$characteristics = list(n = 300, f = 3) + tsk_2$characteristics = list(n = 200, f = 2) + + design = benchmark_grid( + task = list(tsk_1, tsk_2), + learner = learner, + resampling = resampling + ) + + bmr = benchmark(design) + tab = as.data.table(bmr, task_characteristics = TRUE) + expect_names(names(tab), must.include = c("n", "f")) + expect_subset(tab$n, c(300, 200)) + expect_subset(tab$f, c(2, 3)) + + tsk_1$characteristics = list(n = 300, f = 2) + tsk_2$characteristics = list(n = 200) + + design = benchmark_grid( + task = list(tsk_1, tsk_2), + learner = learner, + resampling = resampling + ) + + bmr = benchmark(design) + tab = as.data.table(bmr, task_characteristics = TRUE) + + expect_names(names(tab), must.include = c("n", "f")) + expect_subset(tab$n, c(300, 200)) + expect_subset(tab$f, c(2, NA_real_)) +}) From 4b1f072682db4230c5d8ef25f6c1c7790ac4919e Mon Sep 17 00:00:00 2001 From: Marc Becker <33069354+be-marc@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:27:54 +0100 Subject: [PATCH 5/7] fix: measure checks (#1212) --- R/Measure.R | 17 +++++------------ R/MeasureInternalValidScore.R | 2 +- R/assertions.R | 10 ++++++++++ tests/testthat/_snaps/Task.md | 19 +++++++++++++++++++ tests/testthat/test_resample.R | 5 +++++ 5 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 tests/testthat/_snaps/Task.md diff --git a/R/Measure.R b/R/Measure.R index 994afdc2a..ff45b64d8 100644 --- a/R/Measure.R +++ b/R/Measure.R @@ -197,6 +197,9 @@ Measure = R6Class("Measure", assert_measure(self, task = task, learner = learner, prediction = prediction) assert_prediction(prediction, null.ok = "requires_no_prediction" %nin% self$properties) + # check should be added to assert_measure() + # except when the checks are superfluous for rr$score() and bmr$score() + # these checks should be added bellow if ("requires_task" %in% self$properties && is.null(task)) { stopf("Measure '%s' requires a task", self$id) } @@ -205,21 +208,14 @@ Measure = R6Class("Measure", stopf("Measure '%s' requires a learner", self$id) } - if ("requires_model" %in% self$properties && (is.null(learner) || is.null(learner$model))) { - stopf("Measure '%s' requires the trained model", self$id) - } - if ("requires_model" %in% self$properties && is_marshaled_model(learner$model)) { - stopf("Measure '%s' requires the trained model, but model is in marshaled form", self$id) + if (!is_scalar_na(self$task_type) && self$task_type != prediction$task_type) { + stopf("Measure '%s' incompatible with task type '%s'", self$id, prediction$task_type) } if ("requires_train_set" %in% self$properties && is.null(train_set)) { stopf("Measure '%s' requires the train_set", self$id) } - if (!is_scalar_na(self$task_type) && self$task_type != prediction$task_type) { - stopf("Measure '%s' incompatible with task type '%s'", self$id, prediction$task_type) - } - score_single_measure(self, task, learner, train_set, prediction) }, @@ -358,8 +354,6 @@ score_single_measure = function(measure, task, learner, train_set, prediction) { return(NaN) } - - if (!is_scalar_na(measure$predict_type) && measure$predict_type %nin% prediction$predict_types) { # TODO lgr$debug() return(NaN) @@ -370,7 +364,6 @@ score_single_measure = function(measure, task, learner, train_set, prediction) { return(NaN) } - get_private(measure)$.score(prediction = prediction, task = task, learner = learner, train_set = train_set) } diff --git a/R/MeasureInternalValidScore.R b/R/MeasureInternalValidScore.R index 2d60bf3e0..94770c1a1 100644 --- a/R/MeasureInternalValidScore.R +++ b/R/MeasureInternalValidScore.R @@ -33,7 +33,7 @@ MeasureInternalValidScore = R6Class("MeasureInternalValidScore", super$initialize( id = select %??% "internal_valid_score", task_type = NA_character_, - properties = c("na_score", "requires_model", "requires_learner", "requires_no_prediction"), + properties = c("na_score", "requires_learner", "requires_no_prediction"), predict_sets = NULL, predict_type = NA_character_, range = c(-Inf, Inf), diff --git a/R/assertions.R b/R/assertions.R index ebe772792..f4c76fa41 100644 --- a/R/assertions.R +++ b/R/assertions.R @@ -206,6 +206,7 @@ assert_measure = function(measure, task = NULL, learner = NULL, prediction = NUL assert_class(measure, "Measure", .var.name = .var.name) if (!is.null(task)) { + if (!is_scalar_na(measure$task_type) && !test_matching_task_type(task$task_type, measure, "measure")) { stopf("Measure '%s' is not compatible with type '%s' of task '%s'", measure$id, task$task_type, task$id) @@ -221,6 +222,15 @@ assert_measure = function(measure, task = NULL, learner = NULL, prediction = NUL } if (!is.null(learner)) { + + if ("requires_model" %in% measure$properties && is.null(learner$model)) { + stopf("Measure '%s' requires the trained model", measure$id) + } + + if ("requires_model" %in% measure$properties && is_marshaled_model(learner$model)) { + stopf("Measure '%s' requires the trained model, but model is in marshaled form", measure$id) + } + if (!is_scalar_na(measure$task_type) && measure$task_type != learner$task_type) { stopf("Measure '%s' is not compatible with type '%s' of learner '%s'", measure$id, learner$task_type, learner$id) diff --git a/tests/testthat/_snaps/Task.md b/tests/testthat/_snaps/Task.md new file mode 100644 index 000000000..732eafbfb --- /dev/null +++ b/tests/testthat/_snaps/Task.md @@ -0,0 +1,19 @@ +# $characteristics works + + Code + task + Output + (4601 x 58): HP Spam Detection + * Target: type + * Properties: twoclass + * Features (57): + - dbl (57): address, addresses, all, business, capitalAve, + capitalLong, capitalTotal, charDollar, charExclamation, charHash, + charRoundbracket, charSemicolon, charSquarebracket, conference, + credit, cs, data, direct, edu, email, font, free, george, hp, hpl, + internet, lab, labs, mail, make, meeting, money, num000, num1999, + num3d, num415, num650, num85, num857, order, original, our, over, + parts, people, pm, project, re, receive, remove, report, table, + technology, telnet, will, you, your + * Characteristics: foo=1, bar=a + diff --git a/tests/testthat/test_resample.R b/tests/testthat/test_resample.R index 27bbd7b27..7dee66823 100644 --- a/tests/testthat/test_resample.R +++ b/tests/testthat/test_resample.R @@ -520,3 +520,8 @@ test_that("resampling instantiated on a different task throws an error", { expect_error(resample(tsk("pima"), lrn("classif.rpart"), resampling), "The resampling was probably instantiated on a different task") }) + +test_that("$score() checks for models", { + rr = resample(tsk("mtcars"), lrn("regr.debug"), rsmp("holdout")) + expect_error(rr$score(msr("aic")), "requires the trained model") +}) From 4f1762fd8b21886d339725f98e60574bf19280ea Mon Sep 17 00:00:00 2001 From: Marc Becker <33069354+be-marc@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:43:22 +0100 Subject: [PATCH 6/7] release: 0.22.0 (#1204) * release: 0.22.0 * ... * ... * ... --- DESCRIPTION | 2 +- NEWS.md | 3 ++- R/BenchmarkResult.R | 2 +- man/Task.Rd | 6 +++--- tests/testthat/test_Task.R | 18 +++++++++--------- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 28236d721..32db05e66 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: mlr3 Title: Machine Learning in R - Next Generation -Version: 0.21.1.9000 +Version: 0.22.0 Authors@R: c( person("Michel", "Lang", , "michellang@gmail.com", role = "aut", diff --git a/NEWS.md b/NEWS.md index 95136851c..4fbe00895 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,8 @@ -# mlr3 (development version) +# mlr3 0.22.0 * fix: Quantiles must not ascend with probabilities. * refactor: Replace `tsk("boston_housing")` with `tsk("california_housing")`. +* feat: Require unique learner ids in `benchmark_grid()`. * BREAKING CHANGE: Remove ``$loglik()`` method from all learners. * fix: Ignore `future.globals.maxSize` when `future::plan("sequential")` is used. * feat: Add `$characteristics` field to `Task` to store additional information. diff --git a/R/BenchmarkResult.R b/R/BenchmarkResult.R index 97cc4c94d..9ee35c3ce 100644 --- a/R/BenchmarkResult.R +++ b/R/BenchmarkResult.R @@ -551,7 +551,7 @@ as.data.table.BenchmarkResult = function(x, ..., hashes = FALSE, predict_sets = tab = tab[, c("uhash", "task", "learner", "resampling", "iteration", "prediction"), with = FALSE] if (task_characteristics) { - tab[, characteristics := map(task, "characteristics")] + set(tab, j = "characteristics", value = map(tab$task, "characteristics")) tab = unnest(tab, "characteristics") } diff --git a/man/Task.Rd b/man/Task.Rd index f45a41ddc..4e925c1ad 100644 --- a/man/Task.Rd +++ b/man/Task.Rd @@ -147,9 +147,6 @@ Required for \code{\link[=convert_task]{convert_task()}}.} \item{\code{mlr3_version}}{(\code{package_version})\cr Package version of \code{mlr3} used to create the task.} - -\item{\code{characteristics}}{(\code{list()})\cr -List of characteristics of the task, e.g. \code{list(n = 5, p = 7)}.} } \if{html}{\out{}} } @@ -303,6 +300,9 @@ Alternatively, you can provide a \code{\link[=data.frame]{data.frame()}} with th Hash (unique identifier) for all columns except the \code{primary_key}: A \code{character} vector, named by the columns that each element refers to.\cr Columns of different \code{\link{Task}}s or \code{\link{DataBackend}}s that have agreeing \code{col_hashes} always represent the same data, given that the same \code{row}s are selected. The reverse is not necessarily true: There can be columns with the same content that have different \code{col_hashes}.} + +\item{\code{characteristics}}{(\code{list()})\cr +List of characteristics of the task, e.g. \code{list(n = 5, p = 7)}.} } \if{html}{\out{}} } diff --git a/tests/testthat/test_Task.R b/tests/testthat/test_Task.R index 442caeefa..e97e03360 100644 --- a/tests/testthat/test_Task.R +++ b/tests/testthat/test_Task.R @@ -689,9 +689,9 @@ test_that("$characteristics works", { resampling = rsmp("cv", folds = 3) design = benchmark_grid( - task = list(tsk_1, tsk_2), - learner = learner, - resampling = resampling + tasks = list(tsk_1, tsk_2), + learners = learner, + resamplings = resampling ) bmr = benchmark(design) @@ -703,9 +703,9 @@ test_that("$characteristics works", { tsk_2$characteristics = list(n = 200, f = 2) design = benchmark_grid( - task = list(tsk_1, tsk_2), - learner = learner, - resampling = resampling + tasks = list(tsk_1, tsk_2), + learners = learner, + resamplings = resampling ) bmr = benchmark(design) @@ -718,9 +718,9 @@ test_that("$characteristics works", { tsk_2$characteristics = list(n = 200) design = benchmark_grid( - task = list(tsk_1, tsk_2), - learner = learner, - resampling = resampling + tasks = list(tsk_1, tsk_2), + learners = learner, + resamplings = resampling ) bmr = benchmark(design) From 282b53a334e89a9e07164130c8f36bb3f390049c Mon Sep 17 00:00:00 2001 From: be-marc Date: Mon, 25 Nov 2024 08:55:42 +0100 Subject: [PATCH 7/7] release: 0.22.0.9000 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 32db05e66..3ec978986 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: mlr3 Title: Machine Learning in R - Next Generation -Version: 0.22.0 +Version: 0.22.0.9000 Authors@R: c( person("Michel", "Lang", , "michellang@gmail.com", role = "aut", diff --git a/NEWS.md b/NEWS.md index 4fbe00895..d13823242 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# mlr3 (development version) + # mlr3 0.22.0 * fix: Quantiles must not ascend with probabilities.