Skip to contents

Create xgb.DMatrix object

Usage

xgboost_dmatrix(data, label = NULL, ...)

Arguments

data

Matrix or file.

label

Labels (optional).

...

Additional parameters.

Value

An xgb.DMatrix object.

Examples

sim_data <- msaenet::msaenet.sim.binomial(
  n = 100,
  p = 10,
  rho = 0.6,
  coef = rnorm(5, mean = 0, sd = 10),
  snr = 1,
  p.train = 0.8,
  seed = 42
)

xgboost_dmatrix(sim_data$x.tr, label = sim_data$y.tr)
#> xgb.DMatrix  dim: 80 x 10  info: label  colnames: no
xgboost_dmatrix(sim_data$x.te)
#> xgb.DMatrix  dim: 20 x 10  info: NA  colnames: no