Learn R Programming

gpboost (version 0.7.9)

slice: Slice a dataset

Description

Get a new gpb.Dataset containing the specified rows of original gpb.Dataset object

Usage

slice(dataset, ...)

# S3 method for gpb.Dataset slice(dataset, idxset, ...)

Value

constructed sub dataset

Arguments

dataset

Object of class gpb.Dataset

...

other parameters (currently not used)

idxset

an integer vector of indices of rows needed

Examples

Run this code
# \donttest{
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")
# }

Run the code above in your browser using DataLab