getinfo(object, ...)## S3 method for class 'xgb.DMatrix': getinfo(object, name)
## S3 method for class 'xgb.DMatrix': getinfo(object, name)
data(iris) iris[,5] <- as.numeric(iris[,5]) dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5]) labels <- getinfo(dtrain, "label")
Run the code above in your browser using DataLab