dim: Dimensions of an 'gpb.Dataset'

dim.gpb.DatasetR Documentation

Dimensions of an gpb.Dataset

Description

Returns a vector of numbers of rows and of columns in an gpb.Dataset.

Usage

## S3 method for class 'gpb.Dataset'
dim(x, ...)

Arguments

x

Object of class gpb.Dataset

...

other parameters

Details

Note: since nrow and ncol internally use dim, they can also be directly used with an gpb.Dataset object.

Value

a vector of numbers of rows and of columns

Examples


data(agaricus.train, package = "gpboost")
train <- agaricus.train
dtrain <- gpb.Dataset(train$data, label = train$label)

stopifnot(nrow(dtrain) == nrow(train$data))
stopifnot(ncol(dtrain) == ncol(train$data))
stopifnot(all(dim(dtrain) == dim(train$data)))


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