dim.xgb.DMatrix | R Documentation |
Returns a vector of numbers of rows and of columns in an xgb.DMatrix
.
## S3 method for class 'xgb.DMatrix'
dim(x)
x |
Object of class |
Note: since nrow
and ncol
internally use dim
, they can also
be directly used with an xgb.DMatrix
object.
data(agaricus.train, package='xgboost')
train <- agaricus.train
dtrain <- xgb.DMatrix(train$data, label=train$label, nthread = 2)
stopifnot(nrow(dtrain) == nrow(train$data))
stopifnot(ncol(dtrain) == ncol(train$data))
stopifnot(all(dim(dtrain) == dim(train$data)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.