xgboost (version 0.4-2)

xgb.DMatrix: Contruct xgb.DMatrix object

Description

Contruct xgb.DMatrix object from dense matrix, sparse matrix or local file.

Usage

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

Arguments

data
a matrix object, a dgCMatrix object or a character indicating the data file.
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
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 DataCamp Workspace