Skip to contents

Converts an HFData object into an mlr3 Task, either a TaskClassif or a TaskRegr. The target column and task type can be taken from the HFData object or overridden explicitly.

When task_type = "auto", the task type is inferred from the class of the target column: factor and logical columns become classification tasks, numeric and integer columns become regression tasks.

Usage

# S3 method for class 'HFData'
as_task(x, target_names = NULL, task_type = NULL, ...)

Arguments

x

(HFData)
The HFData object to convert.

target_names

(character())
Name of the target column. If NULL, the target stored in x is used. Multiple targets are not supported.

task_type

(character(1))
One of "auto", "classif", or "regr". Defaults to "auto", in which case the type is inferred from the target column.

...

Additional arguments (currently unused).

Value

An mlr3::TaskClassif or mlr3::TaskRegr object.