Convert object to a TaskClassifST. This is a S3 generic, specialized for at least the following objects:
TaskClassifST: Ensure the identity.
data.frame() and mlr3::DataBackend: Provides an alternative to the constructor of TaskClassifST.
sf::sf: Extracts spatial meta data before construction.
mlr3::TaskRegr: Calls mlr3::convert_task().
as_task_classif_st(x, ...)# S3 method for TaskClassifST
as_task_classif_st(x, clone = FALSE, ...)
# S3 method for data.frame
as_task_classif_st(
x,
target,
id = deparse(substitute(x)),
positive = NULL,
coordinate_names,
crs = NA_character_,
coords_as_features = FALSE,
label = NA_character_,
...
)
# S3 method for DataBackend
as_task_classif_st(
x,
target,
id = deparse(substitute(x)),
positive = NULL,
coordinate_names,
crs,
coords_as_features = FALSE,
label = NA_character_,
...
)
# S3 method for sf
as_task_classif_st(
x,
target = NULL,
id = deparse(substitute(x)),
positive = NULL,
coords_as_features = FALSE,
label = NA_character_,
...
)
# S3 method for TaskRegrST
as_task_classif_st(
x,
target = NULL,
drop_original_target = FALSE,
drop_levels = TRUE,
...
)
TaskClassifST
(any)
Object to convert.
(any)
Additional arguments.
(logical(1))
If TRUE, ensures that the returned object is not the same as the input x.
(character(1))
Name of the target column.
(character(1))
Id for the new task.
Defaults to the (deparsed and substituted) name of the data argument.
(character(1))
Level of the positive class. See TaskClassif.
(character(1))
The column names of the coordinates in the data.
(character(1))
Coordinate reference system.
WKT2 or EPSG string.
(logical(1))
If TRUE, coordinates are used as features.
This is a shortcut for task$set_col_roles(c("x", "y"), role = "feature") with the assumption that the coordinates in the data are named "x" and "y".
(character(1))
Label for the new instance.
(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.