| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/xgb.DMatrix.save.R |
| 3 |
\name{xgb.DMatrix.save} |
| 4 |
\alias{xgb.DMatrix.save} |
| 5 |
\title{Save xgb.DMatrix object to binary file} |
| 6 |
\usage{ |
| 7 |
xgb.DMatrix.save(dmatrix, fname) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{dmatrix}{the \code{xgb.DMatrix} object} |
| 11 |
|
| 12 |
\item{fname}{the name of the file to write.} |
| 13 |
} |
| 14 |
\description{ |
| 15 |
Save xgb.DMatrix object to binary file |
| 16 |
} |
| 17 |
\examples{ |
| 18 |
\dontshow{RhpcBLASctl::omp_set_num_threads(1)} |
| 19 |
data(agaricus.train, package = "xgboost") |
| 20 |
|
| 21 |
dtrain <- with(agaricus.train, xgb.DMatrix(data, label = label, nthread = 2)) |
| 22 |
fname <- file.path(tempdir(), "xgb.DMatrix.data") |
| 23 |
xgb.DMatrix.save(dtrain, fname) |
| 24 |
dtrain <- xgb.DMatrix(fname, nthread = 1) |
| 25 |
} |