xgboost (version 0.4-4)

nrow,xgb.DMatrix-method: Number of xgb.DMatrix rows

Description

nrow return the number of rows present in the xgb.DMatrix.

Usage

"nrow"(x)

Arguments

x
Object of class xgb.DMatrix

Examples

Run this code
data(agaricus.train, package='xgboost')
train <- agaricus.train
dtrain <- xgb.DMatrix(train$data, label=train$label)
stopifnot(nrow(dtrain) == nrow(train$data))

Run the code above in your browser using DataCamp Workspace