dimnames.xgb.DMatrix

0th

Percentile

Handling of column names of xgb.DMatrix

Only column names are supported for xgb.DMatrix, thus setting of row names would have no effect and returnten row names would be NULL.

Usage
# S3 method for xgb.DMatrix
dimnames(x)

# S3 method for xgb.DMatrix dimnames(x) <- value

Arguments
x

object of class xgb.DMatrix

value

a list of two elements: the first one is ignored and the second one is column names

Details

Generic dimnames methods are used by colnames. Since row names are irrelevant, it is recommended to use colnames directly.

Aliases
  • dimnames.xgb.DMatrix
  • dimnames<-.xgb.DMatrix
Examples
# NOT RUN {
data(agaricus.train, package='xgboost')
train <- agaricus.train
dtrain <- xgb.DMatrix(train$data, label=train$label)
dimnames(dtrain)
colnames(dtrain)
colnames(dtrain) <- make.names(1:ncol(train$data))
print(dtrain, verbose=TRUE)

# }
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.