Learn R Programming

xgboost (version 1.4.1.1)

xgb.DMatrix.save: Save xgb.DMatrix object to binary file

Description

Save xgb.DMatrix object to binary file

Usage

xgb.DMatrix.save(dmatrix, fname)

Arguments

dmatrix

the xgb.DMatrix object

fname

the name of the file to write.

Examples

Run this code
# NOT RUN {
data(agaricus.train, package='xgboost')
train <- agaricus.train
dtrain <- xgb.DMatrix(train$data, label=train$label)
xgb.DMatrix.save(dtrain, 'xgb.DMatrix.data')
dtrain <- xgb.DMatrix('xgb.DMatrix.data')
if (file.exists('xgb.DMatrix.data')) file.remove('xgb.DMatrix.data')
# }

Run the code above in your browser using DataLab