lgb.Dataset.set.reference: Set reference of 'lgb.Dataset'

View source: R/lgb.Dataset.R

lgb.Dataset.set.referenceR Documentation

Set reference of lgb.Dataset

Description

If you want to use validation data, you should set reference to training data

Usage

lgb.Dataset.set.reference(dataset, reference)

Arguments

dataset

object of class lgb.Dataset

reference

object of class lgb.Dataset

Value

the dataset you passed in

Examples




# create training Dataset
data(agaricus.train, package ="lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)

# create a validation Dataset, using dtrain as a reference
data(agaricus.test, package = "lightgbm")
test <- agaricus.test
dtest <- lgb.Dataset(test$data, label = test$label)
lgb.Dataset.set.reference(dtest, dtrain)


lightgbm documentation built on Sept. 11, 2024, 8:44 p.m.