as_task_regr {mlr3} | R Documentation |
Convert to a Regression Task
Description
Convert object to a TaskRegr. This is a S3 generic. mlr3 ships with methods for the following objects:
-
TaskRegr: ensure the identity
-
formula
,data.frame()
,matrix()
,Matrix::Matrix()
and DataBackend: provides an alternative to the constructor of TaskRegr. -
TaskClassif: Calls
convert_task()
.
Usage
as_task_regr(x, ...)
## S3 method for class 'TaskRegr'
as_task_regr(x, clone = FALSE, ...)
## S3 method for class 'data.frame'
as_task_regr(
x,
target = NULL,
id = deparse1(substitute(x)),
label = NA_character_,
...
)
## S3 method for class 'matrix'
as_task_regr(
x,
target = NULL,
id = deparse1(substitute(x)),
label = NA_character_,
...
)
## S3 method for class 'Matrix'
as_task_regr(
x,
target = NULL,
id = deparse1(substitute(x)),
label = NA_character_,
...
)
## S3 method for class 'DataBackend'
as_task_regr(
x,
target = NULL,
id = deparse1(substitute(x)),
label = NA_character_,
...
)
## S3 method for class 'TaskClassif'
as_task_regr(
x,
target = NULL,
drop_original_target = FALSE,
drop_levels = TRUE,
...
)
## S3 method for class 'formula'
as_task_regr(
x,
data,
id = deparse1(substitute(data)),
label = NA_character_,
...
)
Arguments
x |
(any) |
... |
(any) |
clone |
( |
target |
( |
id |
( |
label |
( |
drop_original_target |
( |
drop_levels |
( |
data |
( |
Value
Examples
as_task_regr(datasets::mtcars, target = "mpg")