get_field | R Documentation |
lgb.Dataset
Get one attribute of a lgb.Dataset
get_field(dataset, field_name)
## S3 method for class 'lgb.Dataset'
get_field(dataset, field_name)
dataset |
Object of class |
field_name |
String with the name of the attribute to get. One of the following.
|
requested attribute
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
lgb.Dataset.construct(dtrain)
labels <- lightgbm::get_field(dtrain, "label")
lightgbm::set_field(dtrain, "label", 1 - labels)
labels2 <- lightgbm::get_field(dtrain, "label")
stopifnot(all(labels2 == 1 - labels))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.