slice | R Documentation |
Get a new lgb.Dataset
containing the specified rows of
original lgb.Dataset
object
slice(dataset, ...) ## S3 method for class 'lgb.Dataset' slice(dataset, idxset, ...)
dataset |
Object of class |
... |
other parameters (currently not used) |
idxset |
an integer vector of indices of rows needed |
constructed sub dataset
data(agaricus.train, package = "lightgbm") train <- agaricus.train dtrain <- lgb.Dataset(train$data, label = train$label) dsub <- lightgbm::slice(dtrain, seq_len(42L)) lgb.Dataset.construct(dsub) labels <- lightgbm::get_field(dsub, "label")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.