The task's target is replaced by a different column from the data.
convert_task(
intask,
target = NULL,
new_type = NULL,
drop_original_target = FALSE,
drop_levels = TRUE
)as_task_classif(x, target = NULL, ...)
# S3 method for TaskRegr
as_task_classif(
x,
target = NULL,
drop_original_target = FALSE,
drop_levels = TRUE,
...
)
# S3 method for data.frame
as_task_classif(
x,
target = NULL,
id = deparse(substitute(x)),
positive = NULL,
...
)
as_task_regr(x, target = NULL, ...)
# S3 method for TaskClassif
as_task_regr(
x,
target = NULL,
drop_original_target = FALSE,
drop_levels = TRUE,
...
)
# S3 method for data.frame
as_task_regr(
x,
target = NULL,
id = deparse(substitute(x)),
positive = NULL,
...
)
(character(1))
New target to be set, must be a column in the intask data.
If NULL, no new target is set, and task is converted as-is.
(character(1))
The new task type. Must be in mlr_reflections$task_types].
If NULL (default), a new task with the same task_type is created.
(logical(1))
If FALSE (default), the original target is added as a feature.
Otherwise the original target is dropped.
(logical(1))
If TRUE (default), unused levels of the new target variable are dropped.
(any)
Object to convert.
(any)
Additional arguments, currently ignored.
(character(1))
Id for the new task.
(character(1))
Level of the positive class. See TaskClassif.
Task of requested type.