Learn R Programming

xgboost (version 0.6-4)

xgb.DMatrix: Contruct xgb.DMatrix object

Description

Contruct xgb.DMatrix object from dense matrix, sparse matrix or local file (that was created previously by saving an xgb.DMatrix).

Usage

xgb.DMatrix(data, info = list(), missing = NA, ...)

Arguments

data

a matrix object, a dgCMatrix object or a character representing a filename

info

a list of information of the xgb.DMatrix object

missing

Missing is only used when input is dense matrix, pick a float value that represents missing value. Sometime a data use 0 or other extreme value to represents missing values.

...

other information to pass to info.

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')
# }

Run the code above in your browser using DataLab