Skip to content

Commit a073ba9

Browse files
committed
...
1 parent 7b5c2b6 commit a073ba9

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

R/Task.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,15 +1473,15 @@ task_check_col_roles.TaskClassif = function(task, new_roles, ...) {
14731473

14741474
# check target
14751475
if (length(new_roles[["target"]]) > 1L) {
1476-
error_config("There may only be up to one column with role 'target'")
1476+
error_input("There may only be up to one column with role 'target'")
14771477
}
14781478

14791479
if (length(new_roles[["target"]]) && any(fget_keys(task$col_info, new_roles[["target"]], "type", key = "id") %nin% c("factor", "ordered"))) {
1480-
error_config("Target column(s) %s must be a factor or ordered factor", paste0("'", new_roles[["target"]], "'", collapse = ","))
1480+
error_input("Target column(s) %s must be a factor or ordered factor", paste0("'", new_roles[["target"]], "'", collapse = ","))
14811481
}
14821482

14831483
if (length(new_roles[["offset"]]) > 1L && length(task$class_names) == 2L) {
1484-
error_config("There may only be up to one column with role 'offset' for binary classification tasks")
1484+
error_input("There may only be up to one column with role 'offset' for binary classification tasks")
14851485
}
14861486

14871487
if (length(new_roles[["offset"]]) > 1L) {
@@ -1497,12 +1497,12 @@ task_check_col_roles.TaskClassif = function(task, new_roles, ...) {
14971497
task_check_col_roles.TaskRegr = function(task, new_roles, ...) {
14981498
for (role in c("target", "offset")) {
14991499
if (length(new_roles[[role]]) > 1L) {
1500-
error_config("There may only be up to one column with role '%s'", role)
1500+
error_input("There may only be up to one column with role '%s'", role)
15011501
}
15021502
}
15031503

15041504
if (length(new_roles[["target"]]) && any(fget_keys(task$col_info, new_roles[["target"]], "type", key = "id") %nin% c("numeric", "integer"))) {
1505-
error_config("Target column '%s' must be a numeric or integer column", paste0("'", new_roles[["target"]], "'", collapse = ","))
1505+
error_input("Target column '%s' must be a numeric or integer column", paste0("'", new_roles[["target"]], "'", collapse = ","))
15061506
}
15071507

15081508
NextMethod()
@@ -1514,7 +1514,7 @@ task_check_col_roles.TaskSupervised = function(task, new_roles, ...) {
15141514

15151515
# check target
15161516
if (length(new_roles$target) == 0L) {
1517-
error_config("Supervised tasks need at least one target column")
1517+
error_input("Supervised tasks need at least one target column")
15181518
}
15191519

15201520
NextMethod()
@@ -1526,7 +1526,7 @@ task_check_col_roles.TaskUnsupervised = function(task, new_roles, ...) {
15261526

15271527
# check target
15281528
if (length(new_roles$target) != 0L) {
1529-
error_config("Unsupervised tasks may not have a target column")
1529+
error_input("Unsupervised tasks may not have a target column")
15301530
}
15311531

15321532
NextMethod()

R/assertions.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ assert_scorable = function(measure, task, learner, prediction = NULL, .var.name
313313
assert_measures = function(measures, task = NULL, learner = NULL, .var.name = vname(measures)) {
314314
lapply(measures, assert_measure, task = task, learner = learner, .var.name = .var.name)
315315
if (anyDuplicated(ids(measures))) {
316-
error_config("Measures need to have unique IDs")
316+
error_input("Measures need to have unique IDs")
317317
}
318318
invisible(measures)
319319
}
@@ -429,12 +429,12 @@ assert_row_sums = function(prob) {
429429
n_missing = count_missing(x)
430430
if (n_missing > 0L) {
431431
if (n_missing < length(x)) {
432-
error_config("Probabilities for observation %i are partly missing", i)
432+
error_input("Probabilities for observation %i are partly missing", i)
433433
}
434434
} else {
435435
s = sum(x)
436436
if (abs(s - 1) > 0.001) {
437-
error_config("Probabilities for observation %i do sum up to %f != 1", i, s) # TODO error_input?
437+
error_input("Probabilities for observation %i do sum up to %f != 1", i, s)
438438
}
439439
}
440440
}

R/worker.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,12 @@ create_internal_valid_task = function(validate, task, test_row_ids, prev_valid,
557557
error_config("Parameter 'validate' is set to 'predefined' but no internal validation task is present. This commonly happens in GraphLearners and can be avoided by configuring the validation data for the GraphLearner via `set_validate(glrn, validate = values)`. See https://mlr3book.mlr-org.com/chapters/chapter15/predsets_valid_inttune.html for more information.")
558558
}
559559
if (!identical(task$target_names, task$internal_valid_task$target_names)) {
560-
error_input("Internal validation task '%s' has different target names than primary task '%s', did you modify the task after creating the internal validation task?",
561-
task$internal_valid_task$id, task$id) # TODO error_config?
560+
error_config("Internal validation task '%s' has different target names than primary task '%s', did you modify the task after creating the internal validation task?",
561+
task$internal_valid_task$id, task$id)
562562
}
563563
if (!test_permutation(task$feature_names, task$internal_valid_task$feature_names)) {
564-
error_input("Internal validation task '%s' has different features than primary task '%s', did you modify the task after creating the internal validation task?",
565-
task$internal_valid_task$id, task$id) # TODO error_config?
564+
error_config("Internal validation task '%s' has different features than primary task '%s', did you modify the task after creating the internal validation task?",
565+
task$internal_valid_task$id, task$id)
566566
}
567567
return(task)
568568
} else { # validate is "test"

0 commit comments

Comments
 (0)