View source: R/as_task_classif.R
as_task_classif | R Documentation |
Convert object to a TaskClassif. This is a S3 generic. mlr3 ships with methods for the following objects:
TaskClassif: ensure the identity
formula
, data.frame()
, matrix()
, Matrix::Matrix()
and DataBackend: provides an alternative to the constructor of TaskClassif.
TaskRegr: Calls convert_task()
.
Note that the target column will be converted to a factor()
, if possible.
as_task_classif(x, ...)
## S3 method for class 'TaskClassif'
as_task_classif(x, clone = FALSE, ...)
## S3 method for class 'data.frame'
as_task_classif(
x,
target = NULL,
id = deparse1(substitute(x)),
positive = NULL,
label = NA_character_,
...
)
## S3 method for class 'matrix'
as_task_classif(
x,
target,
id = deparse1(substitute(x)),
label = NA_character_,
...
)
## S3 method for class 'Matrix'
as_task_classif(
x,
target,
id = deparse1(substitute(x)),
label = NA_character_,
...
)
## S3 method for class 'DataBackend'
as_task_classif(
x,
target = NULL,
id = deparse1(substitute(x)),
positive = NULL,
label = NA_character_,
...
)
## S3 method for class 'TaskRegr'
as_task_classif(
x,
target = NULL,
drop_original_target = FALSE,
drop_levels = TRUE,
...
)
## S3 method for class 'formula'
as_task_classif(
x,
data,
id = deparse1(substitute(data)),
positive = NULL,
label = NA_character_,
...
)
x |
(any) |
... |
(any) |
clone |
( |
target |
( |
id |
( |
positive |
( |
label |
( |
drop_original_target |
( |
drop_levels |
( |
data |
( |
TaskClassif.
as_task_classif(palmerpenguins::penguins, target = "species")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.