Convert object to a TaskClust. This is a S3 generic, specialized for at least the following objects:
TaskClust: ensure the identity.
data.frame()
and mlr3::DataBackend: provides an alternative to calling constructor of TaskClust.
Usage
as_task_clust(x, ...)
# S3 method for class 'TaskClust'
as_task_clust(x, clone = FALSE, ...)
# S3 method for class 'data.frame'
as_task_clust(x, id = deparse1(substitute(x)), ...)
# S3 method for class 'DataBackend'
as_task_clust(x, id = deparse1(substitute(x)), ...)
# S3 method for class 'formula'
as_task_clust(x, data, id = deparse1(substitute(data)), ...)
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
.- id
(
character(1)
)
Id for the new task. Defaults to the (deparsed and substituted) name of the data argument.- data
(
data.frame()
)
Data frame containing all columns specified in formulax
.
Examples
as_task_clust(datasets::USArrests)
#>
#> ── <TaskClust> (50x4) ──────────────────────────────────────────────────────────
#> • Target:
#> • Properties: -
#> • Features (4):
#> • int (2): Assault, UrbanPop
#> • dbl (2): Murder, Rape