From 53f7b1e4fc9431e9dda34133a62f0ed0af4e9054 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Sun, 18 Apr 2021 14:09:16 +0200 Subject: [PATCH 1/5] clear cases --- R/BenchmarkResult.R | 7 ++++--- R/Learner.R | 9 ++++++--- R/MeasureDebug.R | 3 ++- R/PredictionDataClassif.R | 2 +- R/ResampleResult.R | 11 +++++++---- R/ResultData.R | 14 ++++++++------ R/Task.R | 4 ++-- R/TaskSupervised.R | 2 +- R/as_prediction_data.R | 3 ++- R/assertions.R | 3 ++- R/default_measures.R | 3 ++- R/mlr_resamplings.R | 3 ++- R/task_converters.R | 2 +- R/worker.R | 2 +- tests/testthat/test_Learner.R | 2 +- tests/testthat/test_PredictionClassif.R | 2 +- tests/testthat/test_Resampling.R | 3 ++- tests/testthat/test_benchmark.R | 2 +- 18 files changed, 46 insertions(+), 31 deletions(-) diff --git a/R/BenchmarkResult.R b/R/BenchmarkResult.R index 16a95790f..411b1be69 100644 --- a/R/BenchmarkResult.R +++ b/R/BenchmarkResult.R @@ -268,7 +268,7 @@ BenchmarkResult = R6Class("BenchmarkResult", tab = insert_named(tab, scores) cns = c("uhash", "nr", "resample_result", "task_id", "learner_id", "resampling_id", "iters", - "warnings", "errors", "params", ids(measures)) + "warnings", "errors", "params", ids(measures)) cns = intersect(cns, names(tab)) tab[, cns, with = FALSE] }, @@ -300,10 +300,11 @@ BenchmarkResult = R6Class("BenchmarkResult", learner_phashes = NULL filter_if_not_null = function(column, hashes) { - if (is.null(hashes)) + if (is.null(hashes)) { fact - else + } else { fact[unique(hashes), on = column, nomatch = NULL] + } } diff --git a/R/Learner.R b/R/Learner.R index 55f310de8..a4488ea42 100644 --- a/R/Learner.R +++ b/R/Learner.R @@ -244,8 +244,9 @@ Learner = R6Class("Learner", } pdata = learner_predict(self, task, row_ids) - if (is.null(pdata)) + if (is.null(pdata)) { return(NULL) + } as_prediction(check_prediction_data(pdata)) }, @@ -269,8 +270,9 @@ Learner = R6Class("Learner", newdata = as.data.table(assert_data_frame(newdata, min.rows = 1L)) if (is.null(task)) { - if (is.null(self$state$train_task)) + if (is.null(self$state$train_task)) { stopf("No task stored, and no task provided") + } task = self$state$train_task$clone() } else { task = assert_task(as_task(task, clone = TRUE)) @@ -414,7 +416,8 @@ Learner = R6Class("Learner", switch(name, .param_set = value$clone(deep = TRUE), fallback = if (is.null(value)) NULL else value$clone(deep = TRUE), - state = { value$log = copy(value$log); value }, + state = { value$log = copy(value$log) + value }, value ) } diff --git a/R/MeasureDebug.R b/R/MeasureDebug.R index 354c2560d..32b65bdc8 100644 --- a/R/MeasureDebug.R +++ b/R/MeasureDebug.R @@ -51,8 +51,9 @@ MeasureDebug = R6Class("MeasureDebug", private = list( .score = function(prediction, ...) { na_ratio = self$param_set$get_values()$na_ratio - if (na_ratio > runif(1L)) + if (na_ratio > runif(1L)) { return(NA_integer_) + } length(prediction$row_ids) } ) diff --git a/R/PredictionDataClassif.R b/R/PredictionDataClassif.R index 603d1e189..070367a1c 100644 --- a/R/PredictionDataClassif.R +++ b/R/PredictionDataClassif.R @@ -90,7 +90,7 @@ c.PredictionDataClassif = function(..., keep_duplicates = TRUE) { if (!keep_duplicates) { keep = !duplicated(tab, by = "row_ids", fromLast = TRUE) tab = tab[keep] - prob = prob[keep,, drop = FALSE] + prob = prob[keep, , drop = FALSE] } result = as.list(tab) diff --git a/R/ResampleResult.R b/R/ResampleResult.R index 17c6539b3..da2b2109d 100644 --- a/R/ResampleResult.R +++ b/R/ResampleResult.R @@ -149,7 +149,7 @@ ResampleResult = R6Class("ResampleResult", set(tab, j = "learner_id", value = ids(tab[["learner"]])) set(tab, j = "resampling_id", value = ids(tab[["resampling"]])) setcolorder(tab, c("task", "task_id", "learner", "learner_id", "resampling", "resampling_id", - "iteration", "prediction")) + "iteration", "prediction")) } if (conditions) { @@ -224,8 +224,9 @@ ResampleResult = R6Class("ResampleResult", task = function(rhs) { assert_ro_binding(rhs) tab = self$data$tasks(self$view) - if (nrow(tab) == 0L) + if (nrow(tab) == 0L) { return(NULL) + } tab$task[[1L]] }, @@ -235,8 +236,9 @@ ResampleResult = R6Class("ResampleResult", learner = function(rhs) { assert_ro_binding(rhs) tab = self$data$learners(self$view, states = FALSE) - if (nrow(tab) == 0L) + if (nrow(tab) == 0L) { return(NULL) + } tab$learner[[1L]] }, @@ -245,8 +247,9 @@ ResampleResult = R6Class("ResampleResult", resampling = function(rhs) { assert_ro_binding(rhs) tab = self$data$resamplings(self$view) - if (nrow(tab) == 0L) + if (nrow(tab) == 0L) { return(NULL) + } tab$resampling[[1L]] }, diff --git a/R/ResultData.R b/R/ResultData.R index 06832183e..2616bffa2 100644 --- a/R/ResultData.R +++ b/R/ResultData.R @@ -295,18 +295,20 @@ ResultData = R6Class("ResultData", #' Returns `NULL` if the [ResultData] is empty. task_type = function() { tab = self$data$tasks - if (nrow(tab)) + if (nrow(tab)) { tab$task[[1L]]$task_type - else + } else { NULL + } } ), private = list( get_view_index = function(view) { - if (is.null(view)) + if (is.null(view)) { return(TRUE) - self$data$fact[list(view), on = "uhash", nomatch = NULL, which = TRUE] + } + self$data$fact[list(view), on = "uhash", nomatch = NULL, which = TRUE] }, deep_clone = function(name, value) { @@ -382,8 +384,8 @@ reassemble_learners = function(learners, states = NULL, param_vals = NULL) { learners = lapply(learners, function(l) l$clone(deep = TRUE)) if (!is.null(states)) { - Map(function(l, s) { - l$state = s + Map(function(l, s) { + l$state = s }, l = learners, s = states) } diff --git a/R/Task.R b/R/Task.R index ac7063145..0ed0fb57b 100644 --- a/R/Task.R +++ b/R/Task.R @@ -351,8 +351,8 @@ Task = R6Class("Task", ci = self$col_info[list(keep_cols), on = "id"] data = do.call(data.table, Map(auto_convert, - value = as.list(data)[ci$id], - id = ci$id, type = ci$type, levels = ci$levels)) + value = as.list(data)[ci$id], + id = ci$id, type = ci$type, levels = ci$levels)) data = as_data_backend(data, primary_key = pk) } else { diff --git a/R/TaskSupervised.R b/R/TaskSupervised.R index 97b42c13b..2bf59246f 100644 --- a/R/TaskSupervised.R +++ b/R/TaskSupervised.R @@ -19,7 +19,7 @@ #' @export #' @examples #' TaskSupervised$new("penguins", task_type = "classif", backend = palmerpenguins::penguins, -#' target = "species") +#' target = "species") TaskSupervised = R6Class("TaskSupervised", inherit = Task, public = list( diff --git a/R/as_prediction_data.R b/R/as_prediction_data.R index 8845f8a3b..b510a7740 100644 --- a/R/as_prediction_data.R +++ b/R/as_prediction_data.R @@ -35,8 +35,9 @@ as_prediction_data.list = function(x, task, row_ids = task$row_ids, check = TRUE assert_names(names(x), subset.of = predict_types) x$row_ids = row_ids - if (inherits(task, "TaskSupervised")) + if (inherits(task, "TaskSupervised")) { x$truth = task$truth(row_ids) + } pdata = new_prediction_data(x, task_type = task$task_type) if (check) { diff --git a/R/assertions.R b/R/assertions.R index 2edb63eb4..9529b9238 100644 --- a/R/assertions.R +++ b/R/assertions.R @@ -163,8 +163,9 @@ assert_measure = function(measure, task = NULL, learner = NULL, .var.name = vnam #' @rdname mlr_assertions assert_measures = function(measures, task = NULL, learner = NULL, .var.name = vname(measures)) { lapply(measures, assert_measure, task = task, learner = learner, .var.name = .var.name) - if (anyDuplicated(ids(measures))) + if (anyDuplicated(ids(measures))) { stopf("Measures need to have unique IDs") + } invisible(measures) } diff --git a/R/default_measures.R b/R/default_measures.R index d829c7397..1d1a13dd3 100644 --- a/R/default_measures.R +++ b/R/default_measures.R @@ -17,8 +17,9 @@ #' default_measures("classif") #' default_measures("regr") default_measures = function(task_type) { - if (is.null(task_type)) + if (is.null(task_type)) { return(list()) + } assert_choice(task_type, names(mlr_reflections$default_measures)) keys = mlr_reflections$default_measures[[task_type]] mlr_measures$mget(keys) diff --git a/R/mlr_resamplings.R b/R/mlr_resamplings.R index 6f9a723f8..c81ecd833 100644 --- a/R/mlr_resamplings.R +++ b/R/mlr_resamplings.R @@ -39,8 +39,9 @@ as.data.table.DictionaryResampling = function(x, ...) { # nolint setkeyv(map_dtr(x$keys(), function(key) { r = tryCatch(x$get(key), missingDefaultError = function(e) NULL) - if (is.null(r)) + if (is.null(r)) { return(list(key = key)) + } list(key = key, params = list(r$param_set$ids()), iters = r$iters) }, .fill = TRUE), "key")[] diff --git a/R/task_converters.R b/R/task_converters.R index 5ec79ee41..27131615e 100644 --- a/R/task_converters.R +++ b/R/task_converters.R @@ -40,7 +40,7 @@ convert_task = function(intask, target = NULL, new_type = NULL, drop_original_ta # Add the original target(s) as features, only keeping 'new_target'. if (!all(intask$target_names == target)) { - newtask$set_col_roles(setdiff(intask$col_roles$target, target), "feature") + newtask$set_col_roles(setdiff(intask$col_roles$target, target), "feature") } # during prediction, when target is NA, we do not call droplevels diff --git a/R/worker.R b/R/worker.R index 7cf95af9a..77dd6a916 100644 --- a/R/worker.R +++ b/R/worker.R @@ -173,7 +173,7 @@ learner_predict = function(learner, task, row_ids = NULL) { miss_ids = is_missing_prediction_data(prediction) lg$debug("Imputing %i/%i predictions using fallback '%s'", - length(miss_ids), length(prediction$row_ids), fb$id, learner = fb$clone()) + length(miss_ids), length(prediction$row_ids), fb$id, learner = fb$clone()) if (length(miss_ids)) { learner$state$log = append_log(learner$state$log, "predict", "output", "Using fallback learner to impute predictions") diff --git a/tests/testthat/test_Learner.R b/tests/testthat/test_Learner.R index 6cde9faac..fca3eee17 100644 --- a/tests/testthat/test_Learner.R +++ b/tests/testthat/test_Learner.R @@ -173,7 +173,7 @@ test_that("predict train + test set", { }) test_that("assertions work (#357)", { - measures = lapply(c("classif.auc","classif.acc"), msr) + measures = lapply(c("classif.auc", "classif.acc"), msr) task = tsk("iris") lrn = lrn("classif.featureless") p = lrn$train(task)$predict(task) diff --git a/tests/testthat/test_PredictionClassif.R b/tests/testthat/test_PredictionClassif.R index 1a421f9a0..f05a36aeb 100644 --- a/tests/testthat/test_PredictionClassif.R +++ b/tests/testthat/test_PredictionClassif.R @@ -25,7 +25,7 @@ test_that("setting threshold binaryclass", { expect_equal(as.character(p$response), colnames(p$prob)[max.col(p$prob)]) response_before = p$response - expect_false(withVisible(p$set_threshold(0.5))$visible) #356 + expect_false(withVisible(p$set_threshold(0.5))$visible) # 356 expect_factor(p$response, levels = task$class_names, any.missing = FALSE) expect_equal(p$response, response_before) expect_lt(p$score(msr("classif.ce")), 0.25) diff --git a/tests/testthat/test_Resampling.R b/tests/testthat/test_Resampling.R index ea5fcc2f0..b1c3aef67 100644 --- a/tests/testthat/test_Resampling.R +++ b/tests/testthat/test_Resampling.R @@ -67,8 +67,9 @@ test_that("cloning", { clone = r$clone(deep = TRUE) expect_different_address(r$param_set, clone$param_set) - if (is.data.table(r$instance)) + if (is.data.table(r$instance)) { expect_different_address(r$instance, clone$instance) + } } }) diff --git a/tests/testthat/test_benchmark.R b/tests/testthat/test_benchmark.R index a4a51276b..34f8babaa 100644 --- a/tests/testthat/test_benchmark.R +++ b/tests/testthat/test_benchmark.R @@ -256,7 +256,7 @@ test_that("parallelization works", { grid = benchmark_grid(list(tsk("wine"), tsk("sonar")), replicate(2, lrn("classif.debug")), rsmp("cv", folds = 2)) njobs = 3L - bmr = with_future(future::multisession, { + bmr = with_future(future::multisession, { benchmark(grid, store_models = TRUE) }, workers = njobs) From 65803e4cf0e4d974d8baf16422f414f398d52f8b Mon Sep 17 00:00:00 2001 From: Lorenz Date: Sun, 18 Apr 2021 14:37:58 +0200 Subject: [PATCH 2/5] more unambiguous formatting --- R/Learner.R | 6 ++-- R/auto_convert.R | 57 ++++++++++++++++++++++++++++---------- R/benchmark_grid.R | 3 +- tests/testthat/test_Task.R | 16 ++++++++--- 4 files changed, 60 insertions(+), 22 deletions(-) diff --git a/R/Learner.R b/R/Learner.R index a4488ea42..7456a7401 100644 --- a/R/Learner.R +++ b/R/Learner.R @@ -416,8 +416,10 @@ Learner = R6Class("Learner", switch(name, .param_set = value$clone(deep = TRUE), fallback = if (is.null(value)) NULL else value$clone(deep = TRUE), - state = { value$log = copy(value$log) - value }, + state = { + value$log = copy(value$log) + value + }, value ) } diff --git a/R/auto_convert.R b/R/auto_convert.R index 6f3761377..bf3b610ce 100644 --- a/R/auto_convert.R +++ b/R/auto_convert.R @@ -5,21 +5,35 @@ mlr_reflections$auto_converters = ee = new.env(parent = emptyenv()) ## from: logical ee[["logical___integer"]] = - function(value, type, levels) { as.integer(value) } + function(value, type, levels) { + as.integer(value) + } ee[["logical___numeric"]] = - function(value, type, levels) { as.double(value) } + function(value, type, levels) { + as.double(value) + } ee[["logical___character"]] = - function(value, type, levels) { as.character(value) } + function(value, type, levels) { + as.character(value) + } ee[["logical___factor"]] = - function(value, type, levels) { factor(value, levels = union(levels, value), ordered = FALSE) } + function(value, type, levels) { + factor(value, levels = union(levels, value), ordered = FALSE) + } ee[["logical___ordered"]] = - function(value, type, levels) { if (all(value %in% c(NA_character_, levels))) factor(value, levels = levels, ordered = TRUE) else NULL } + function(value, type, levels) { + if (all(value %in% c(NA_character_, levels))) factor(value, levels = levels, ordered = TRUE) else NULL + } ee[["logical___POSIXct"]] = - function(value, type, levels) { if (allMissing(value)) .POSIXct(value, tz = "") else value } + function(value, type, levels) { + if (allMissing(value)) .POSIXct(value, tz = "") else value + } ## from: integer ee[["integer___logical"]] = - function(value, type, levels) { if (test_integerish(value, lower = 0L, upper = 1L)) as.logical(value) else value } + function(value, type, levels) { + if (test_integerish(value, lower = 0L, upper = 1L)) as.logical(value) else value + } ee[["integer___numeric"]] = ee[["logical___numeric"]] ee[["integer___character"]] = @@ -35,7 +49,9 @@ ee[["integer___POSIXct"]] = ee[["numeric___logical"]] = ee[["integer___logical"]] ee[["numeric___integer"]] = - function(value, type, levels) { if (test_integerish(value)) as.integer(value) else value } + function(value, type, levels) { + if (test_integerish(value)) as.integer(value) else value + } ee[["numeric___character"]] = ee[["logical___character"]] ee[["numeric___factor"]] = @@ -47,17 +63,26 @@ ee[["numeric___POSIXct"]] = ## from: character ee[["character___logical"]] = - function(value, type, levels) { if (all(value %in% c(NA_character_, "TRUE", "FALSE", "true", "false", "T", "F"))) as.logical(value) else value } + function(value, type, levels) { + if (all(value %in% c(NA_character_, "TRUE", "FALSE", "true", "false", "T", "F"))) as.logical(value) else value + } ee[["character___integer"]] = - function(value, type, levels) { if (allMissing(value)) as.integer(value) else value } + function(value, type, levels) { + if (allMissing(value)) as.integer(value) else value + } ee[["character___numeric"]] = - function(value, type, levels) { if (allMissing(value)) as.double(value) else value } + function(value, type, levels) { + if (allMissing(value)) as.double(value) else value + } ee[["character___factor"]] = ee[["logical___factor"]] ee[["character___ordered"]] = ee[["logical___ordered"]] ee[["character___POSIXct"]] = - function(value, type, levels) { x = try(as.POSIXct(value, ""), silent = TRUE); if (inherits(x, "try-error")) value else x } + function(value, type, levels) { + x = try(as.POSIXct(value, ""), silent = TRUE) + if (inherits(x, "try-error")) value else x + } ## from: factor ee[["factor___logical"]] = @@ -65,9 +90,13 @@ ee[["factor___logical"]] = ee[["factor___character"]] = ee[["logical___character"]] ee[["factor___factor"]] = - function(value, type, levels) { factor(value, levels = union(levels, levels(value)), ordered = FALSE) } + function(value, type, levels) { + factor(value, levels = union(levels, levels(value)), ordered = FALSE) + } ee[["factor___ordered"]] = - function(value, type, levels) { if (all(levels(value) %in% levels)) factor(value, levels = levels, ordered = TRUE) else NULL } + function(value, type, levels) { + if (all(levels(value) %in% levels)) factor(value, levels = levels, ordered = TRUE) else NULL + } ee[["factor___POSIXct"]] = ee[["character___POSIXct"]] diff --git a/R/benchmark_grid.R b/R/benchmark_grid.R index 57af638ae..34f842a21 100644 --- a/R/benchmark_grid.R +++ b/R/benchmark_grid.R @@ -32,9 +32,8 @@ #' #' # manual instantiation (not suited for a fair comparison of learners!) #' Map(function(task, resampling) { -#' resampling$instantiate(task) +#' resampling$instantiate(task) #' }, task = grid$task, resampling = grid$resampling) -#' #' \dontrun{ #' benchmark(grid) #' } diff --git a/tests/testthat/test_Task.R b/tests/testthat/test_Task.R index e8e7bf05a..c480837ea 100644 --- a/tests/testthat/test_Task.R +++ b/tests/testthat/test_Task.R @@ -246,7 +246,9 @@ test_that("groups/weights work", { task$col_roles$group = character() expect_true("groups" %nin% task$properties) - expect_error({task$col_roles$weight = c("w", "g")}, "up to one") + expect_error({ + task$col_roles$weight = c("w", "g") + }, "up to one") }) test_that("ordered factors (#95)", { @@ -314,8 +316,12 @@ test_that("switch columns on and off (#301)", { test_that("row roles setters", { task = tsk("iris") - expect_error({ task$row_roles$use = "foo" }) - expect_error({ task$row_roles$foo = 1L }) + expect_error({ + task$row_roles$use = "foo" + }) + expect_error({ + task$row_roles$foo = 1L + }) task$row_roles$use = 1:20 expect_equal(task$nrow, 20L) @@ -324,7 +330,9 @@ test_that("row roles setters", { test_that("col roles getters/setters", { task = tsk("iris") - expect_error({ task$col_roles$feature = "foo" }) + expect_error({ + task$col_roles$feature = "foo" + }) # additional roles allowed (#558) task$col_roles$foo = "Species" From 86adbd1678422a50c824c6ced28809bdf3dc37b9 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Sun, 18 Apr 2021 23:39:30 +0200 Subject: [PATCH 3/5] can't do alignment as it was before --- R/TaskClassif_penguins.R | 2 +- R/TaskGeneratorMoons.R | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/TaskClassif_penguins.R b/R/TaskClassif_penguins.R index f12080608..1d02d85a4 100644 --- a/R/TaskClassif_penguins.R +++ b/R/TaskClassif_penguins.R @@ -35,7 +35,7 @@ load_task_penguins = function() { penguins = as.data.table(palmerpenguins::penguins) setnames(penguins, old = c("bill_length_mm", "bill_depth_mm", "flipper_length_mm", "body_mass_g"), - new = c("bill_length", "bill_depth", "flipper_length", "body_mass") + new = c("bill_length", "bill_depth", "flipper_length", "body_mass") ) b = as_data_backend(penguins) diff --git a/R/TaskGeneratorMoons.R b/R/TaskGeneratorMoons.R index 72a9c3014..4b430781b 100644 --- a/R/TaskGeneratorMoons.R +++ b/R/TaskGeneratorMoons.R @@ -57,9 +57,9 @@ TaskGeneratorMoons = R6Class("TaskGeneratorMoons", x = c(runif(n1, 0, pi), runif(n2, pi, 2 * pi)) data.table( - y = factor(rep(c("A", "B"), c(n1, n2)), levels = c("A", "B")), - x1 = 5 * cos(x) + rnorm(n, mean = mu, sd = sigma), - x2 = 10 * sin(x) + rnorm(n, mean = mu, sd = sigma) + y = factor(rep(c("A", "B"), c(n1, n2)), levels = c("A", "B")), + x1 = 5 * cos(x) + rnorm(n, mean = mu, sd = sigma), + x2 = 10 * sin(x) + rnorm(n, mean = mu, sd = sigma) ) }, From 0d5a223906818f918184e3a32b23dfd504841e2b Mon Sep 17 00:00:00 2001 From: Lorenz Date: Sun, 18 Apr 2021 23:45:37 +0200 Subject: [PATCH 4/5] fix alignment --- R/bibentries.R | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/R/bibentries.R b/R/bibentries.R index 0043f75d3..990930aff 100644 --- a/R/bibentries.R +++ b/R/bibentries.R @@ -14,16 +14,16 @@ bibentries = c( ), bischl_2012 = bibentry("article", - title = "Resampling Methods for Meta-Model Validation with Recommendations for Evolutionary Computation", - author = "Bernd Bischl and Olaf Mersmann and Heike Trautmann and Claus Weihs", - year = "2012", - month = "jun", - journal = "Evolutionary Computation", - publisher = "MIT Press - Journals", - volume = "20", - number = "2", - pages = "249--275", - doi = "10.1162/evco_a_00069" + title = "Resampling Methods for Meta-Model Validation with Recommendations for Evolutionary Computation", + author = "Bernd Bischl and Olaf Mersmann and Heike Trautmann and Claus Weihs", + year = "2012", + month = "jun", + journal = "Evolutionary Computation", + publisher = "MIT Press - Journals", + volume = "20", + number = "2", + pages = "249--275", + doi = "10.1162/evco_a_00069" ), breiman_1984 = bibentry("book", From 087e17f146ea63e459da7b02a894fbdea507e8ed Mon Sep 17 00:00:00 2001 From: Lorenz Date: Sun, 18 Apr 2021 23:49:23 +0200 Subject: [PATCH 5/5] right align for detection --- R/mlr_reflections.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/mlr_reflections.R b/R/mlr_reflections.R index 98ea47931..af0ecf340 100644 --- a/R/mlr_reflections.R +++ b/R/mlr_reflections.R @@ -74,9 +74,9 @@ local({ ### Task # task types + constructors mlr_reflections$task_types = rowwise_table(.key = "type", - ~type, ~package, ~task, ~learner, ~prediction, ~measure, - "regr", "mlr3", "TaskRegr", "LearnerRegr", "PredictionRegr", "MeasureRegr", - "classif", "mlr3", "TaskClassif", "LearnerClassif", "PredictionClassif", "MeasureClassif" + ~type, ~package, ~task, ~learner, ~prediction, ~measure, + "regr", "mlr3", "TaskRegr", "LearnerRegr", "PredictionRegr", "MeasureRegr", + "classif", "mlr3", "TaskClassif", "LearnerClassif", "PredictionClassif", "MeasureClassif" ) mlr_reflections$task_feature_types = c(