Learn R Programming

Laurae (version 0.0.0.9001)

LauraeML_utils.xgb_data: Laurae's Machine Learning Utility: create xgboost dataset

Description

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

Usage

LauraeML_utils.xgb_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

Run this code
## Not run: ------------------------------------
# for (i in 1:5) {
#   # First we create the training data
#   temp_train <- LauraeML_utils.xgb_data(data = mini_data,
#                                         fold = folds[[i]],
#                                         label = label,
#                                         is_train = TRUE)
# 
#   # Second we create the testing data
#   temp_test <- LauraeML_utils.xgb_data(data = mini_data,
#                                        fold = folds[[i]],
#                                        label = label,
#                                        is_train = FALSE)
# }
## ---------------------------------------------

Run the code above in your browser using DataLab