R: Save 'lgb.Dataset' to a binary file

lgb.Dataset.save {lightgbm} | R Documentation

## Save `lgb.Dataset` to a binary file

### Description

Please note that `init_score` is not saved in binary file. If you need it, please set it again after loading Dataset.

### Usage

    lgb.Dataset.save(dataset, fname)

### Arguments

`dataset` | object of class `lgb.Dataset`
`fname` | object filename of output file

### Value

the dataset you passed in

### Examples

    data(agaricus.train, package = "lightgbm")
    train <- agaricus.train
    dtrain <- lgb.Dataset(train$data, label = train$label)
    lgb.Dataset.save(dtrain, tempfile(fileext = ".bin"))

[Package lightgbm version 3.1.0 Index]