![](../logo.png)
Convert to a Spatiotemporal Classification Task
Source:R/as_task_classif_st.R
as_task_classif_st.Rd
Convert object to a TaskClassifST. This is a S3 generic, specialized for at least the following objects:
TaskClassifST: Ensure the identity.
data.frame()
and DataBackend: Provides an alternative to the constructor of TaskClassifST.sf::sf: Extracts spatial meta data before construction.
TaskRegr: Calls
convert_task()
.
Usage
as_task_classif_st(x, ...)
# S3 method for class 'TaskClassifST'
as_task_classif_st(x, clone = FALSE, ...)
# S3 method for class '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 class '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 class 'sf'
as_task_classif_st(
x,
target = NULL,
id = deparse(substitute(x)),
positive = NULL,
coords_as_features = FALSE,
label = NA_character_,
...
)
# S3 method for class 'TaskRegrST'
as_task_classif_st(
x,
target = NULL,
drop_original_target = FALSE,
drop_levels = TRUE,
...
)
Arguments
- x
(any)
Object to convert.- ...
(any)
Additional arguments.- clone
(
logical(1)
)
IfTRUE
, ensures that the returned object is not the same as the inputx
.- target
(
character(1)
)
Name of the target column.- id
(
character(1)
)
Id for the new task. Defaults to the (deparsed and substituted) name of the data argument.- positive
(
character(1)
)
Level of the positive class. See TaskClassif.- coordinate_names
(
character(1)
)
The column names of the coordinates in the data.- crs
(
character(1)
)
Coordinate reference system. WKT2 or EPSG string.- coords_as_features
(
logical(1)
)
IfTRUE
, coordinates are used as features.- label
(
character(1)
)
Label for the new instance.- drop_original_target
(
logical(1)
)
IfFALSE
(default), the original target is added as a feature. Otherwise the original target is dropped.- drop_levels
(
logical(1)
)
IfTRUE
(default), unused levels of the new target variable are dropped.