slice {gpboost} | R Documentation |
Slice a dataset
Description
Get a new gpb.Dataset
containing the specified rows of
original gpb.Dataset
object
Usage
slice(dataset, ...)
## S3 method for class 'gpb.Dataset'
slice(dataset, idxset, ...)
Arguments
dataset |
Object of class |
... |
other parameters (currently not used) |
idxset |
an integer vector of indices of rows needed |
Value
constructed sub dataset
Examples
data(agaricus.train, package = "gpboost")
train <- agaricus.train
dtrain <- gpb.Dataset(train$data, label = train$label)
dsub <- gpboost::slice(dtrain, seq_len(42L))
gpb.Dataset.construct(dsub)
labels <- gpboost::getinfo(dsub, "label")
[Package gpboost version 1.5.1.1 Index]