LauraeML_utils.lgb_data: Laurae's Machine Learning Utility: create LightGBM dataset

Description Usage Arguments Examples

Description

This function is a helper function to do create a LightGBM dataset for LauraeML during a training iteration of the optimizer.

Usage

1
LauraeML_utils.lgb_data(data, fold, label, is_train)

Arguments

data

Type: data.table. The data features. Comes from LauraeML.

fold

Type: vector (numeric). The observation rows to keep/remove. Comes from LauraeML.

label

Type: vector (numeric). The labels. Comes from LauraeML.

is_train

Type: logical. Whether the fold refers to testing data (FALSE) or training data (TRUE).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
for (i in 1:5) {
  # First we create the training data
  temp_train <- LauraeML_utils.lgb_data(data = mini_data,
                                        fold = folds[[i]],
                                        label = label,
                                        is_train = TRUE)

  # Second we create the testing data
  temp_test <- LauraeML_utils.lgb_data(data = mini_data,
                                       fold = folds[[i]],
                                       label = label,
                                       is_train = FALSE)
}

## End(Not run)

Laurae2/Laurae documentation built on May 8, 2019, 7:59 p.m.