dim.xgb.DMatrix

0th

Percentile

Dimensions of xgb.DMatrix

Returns a vector of numbers of rows and of columns in an xgb.DMatrix.

Usage
# S3 method for xgb.DMatrix
dim(x)
Arguments
x

Object of class xgb.DMatrix

Details

Note: since nrow and ncol internally use dim, they can also be directly used with an xgb.DMatrix object.

Aliases
  • dim.xgb.DMatrix
Examples
# NOT RUN {
data(agaricus.train, package='xgboost')
train <- agaricus.train
dtrain <- xgb.DMatrix(train$data, label=train$label)

stopifnot(nrow(dtrain) == nrow(train$data))
stopifnot(ncol(dtrain) == ncol(train$data))
stopifnot(all(dim(dtrain) == dim(train$data)))

# }
Documentation reproduced from package xgboost, version 0.6-4, License: Apache License (== 2.0) | file LICENSE

Community examples

Looks like there are no examples yet.