Dataset#

class gpjax.dataset.Dataset(X=None, y=None, n_total=None)[source]#

Bases: object

Base class for datasets.

Parameters:
  • X (Num[jaxlib._jax.Array, 'N D'] | Num[ndarray, 'N D'] | None) – input data.

  • y (Num[jaxlib._jax.Array, 'N Q'] | Num[ndarray, 'N Q'] | None) – output data.

  • n_total (int | None) – full-dataset size when this object is a minibatch view of a larger dataset (stamped by gpjax.fit.get_batch); None means the dataset is self-describing (n_total == n).

Expand for references to gpjax.dataset.Dataset

Likelihood guide / Likelihoods in GPJax

Migrations / 0.18.x → 1.0.0 / OILMM joins the conditioning contract

Migrations / 0.18.x → 1.0.0 / The conditioning API

fit

fit_natgrads

get_batch

ConjugateModel

create_oilmm_from_data

conjugate_loocv

fit

fit_lbfgs

fit_scipy

state_space_mll

property full_size: int#

Size of the dataset this object is a view of.

When the dataset is a minibatch stamped by gpjax.fit.get_batch(), this is the n_total of the parent dataset; otherwise it falls back to n. Minibatch objectives use the ratio full_size / n to rescale the expected log-likelihood term so that a minibatch estimate is unbiased for the full-data objective:

scale = data.full_size / data.n

Both n_total (static pytree aux data) and n (an array shape) are static under jax.jit(), so this is always a concrete Python int and is safe to use in traced code.

Returns:

The full-dataset size.

Return type:

int

property in_dim: int#

Dimension of the inputs, \(X\).

is_supervised()[source]#

Returns True if the dataset is supervised.

Return type:

bool

is_unsupervised()[source]#

Returns True if the dataset is unsupervised.

Return type:

bool

property multi_output: bool#

True if the dataset has more than one output dimension.

property n: int#

Number of observations.

property num_outputs: int#

Number of output dimensions.