Description Usage Arguments Value See Also
View source: R/backend_preprocessing.R
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
.
1 | backend_preprocessing(datatable, target_col, task_type, positive = NULL)
|
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. |
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.
mlr3
, lightgbm::prepare
, mlr3learners.lightgbm
,
plyr::revalue
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.