dimnames.lgb.Dataset | R Documentation |
lgb.Dataset
Only column names are supported for lgb.Dataset
, thus setting of
row names would have no effect and returned row names would be NULL.
## S3 method for class 'lgb.Dataset'
dimnames(x)
## S3 replacement method for class 'lgb.Dataset'
dimnames(x) <- value
x |
object of class |
value |
a list of two elements: the first one is ignored and the second one is column names |
Generic dimnames
methods are used by colnames
.
Since row names are irrelevant, it is recommended to use colnames
directly.
A list with the dimension names of the dataset
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
lgb.Dataset.construct(dtrain)
dimnames(dtrain)
colnames(dtrain)
colnames(dtrain) <- make.names(seq_len(ncol(train$data)))
print(dtrain, verbose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.