R: Set reference of 'lgb.Dataset'

lgb.Dataset.set.reference {lightgbm} | R 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

passed dataset

### Examples

    library(lightgbm)
    data(agaricus.train, package ="lightgbm")
    train <- agaricus.train
    dtrain <- lgb.Dataset(train$data, label = train$label)
    data(agaricus.test, package = "lightgbm")
    test <- agaricus.test
    dtest <- lgb.Dataset(test$data, test = train$label)
    lgb.Dataset.set.reference(dtest, dtrain)

[Package lightgbm version 2.3.1 Index]