backend_preprocessing: backend_preprocessing

Description Usage Arguments Value See Also

View source: R/backend_preprocessing.R

Description

The function transforms the values of a data.table object so that in can be passed to an mlr3 task to be used with the mlr3learners.lightgbm R package. This is necessary because lightgbm can only handle numeric and integer features. Furthermore, for classification tasks the target variable needs to be of type integer with values starting at '0' for the first class. The function is a wrapper around lightgbm::prepare.

Usage

1
backend_preprocessing(datatable, target_col, task_type, positive = NULL)

Arguments

datatable

A data.table object, holding the target variable and features.

target_col

A character. The name of the target variable.

task_type

A character. The type of learning task to prepare 'datatable' for. Can be one of 'regression', 'class:binary' or 'class:multiclass'.

positive

A character. If 'task_type' = 'class:binary', this argument is required to specify the positive class of the binary classification task, which will be replaced by the value '1' in the resulting object.

Value

The function returns a data.table with the transformed target variable and feature variables. This object can then be used to create an mlr3 task to be used with the mlr3learners.lightgbm R package.

See Also

mlr3, lightgbm::prepare, mlr3learners.lightgbm, plyr::revalue


kapsner/mlr3learners.lightgbm documentation built on Feb. 17, 2021, 5:53 p.m.