Please note that init_score
is not saved in binary file.
If you need it, please set it again after loading Dataset.
lgb.Dataset.save(dataset, fname)
object of class lgb.Dataset
object filename of output file
the dataset you passed in
# \donttest{
setLGBMthreads(2L)
data.table::setDTthreads(1L)
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
lgb.Dataset.save(dtrain, tempfile(fileext = ".bin"))
#> [LightGBM] [Info] Saving data to binary file /tmp/Rtmp22BmwX/file114b5a2096b.bin
# }