slice: Slice a dataset

View source: R/gpb.Dataset.R

sliceR 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 gpb.Dataset

...

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")


gpboost documentation built on Oct. 24, 2023, 9:09 a.m.