Skip to content

Gaussian Process API

This API page includes:

  • kernel classes (RBFKernel, MaternKernel, RationalQuadraticKernel, PeriodicKernel, LinearKernel, SpectralMixtureKernel, SumKernel, ProductKernel)
  • regression GP families (exact, sparse, heteroscedastic, multitask ICM, spectral mixture, deep kernel)
  • classification GP families (binary and OvR multiclass)

deepuq.models.gaussian_process

Public Gaussian process APIs for Deep-UQ.

This module preserves historical import paths while delegating implementations into deepuq.models.gp.

DeepKernelGaussianProcessRegressor

Regression-only deep kernel GP with end-to-end marginal-likelihood training.

fit

fit(
    x: Tensor, y: Tensor
) -> "DeepKernelGaussianProcessRegressor"

Fit DKL-GP on regression targets.

predict

predict(
    x_star: Tensor,
    return_cov: bool = False,
    include_noise: bool = True,
) -> Tuple[torch.Tensor, torch.Tensor]

Predict posterior mean and variance/covariance.

predict_uq

predict_uq(x_star: Tensor) -> UQResult

Return standardized UQ output for deep kernel GP regression.

GaussianProcessClassifier

Binary GP classifier using Laplace approximation.

fit

fit(x: Tensor, y: Tensor) -> 'GaussianProcessClassifier'

Fit binary GP classifier.

y must contain binary labels in {0, 1}.

predict

predict(x_star: Tensor) -> torch.Tensor

Return hard class labels for binary GP classification.

predict_proba

predict_proba(x_star: Tensor) -> torch.Tensor

Return p(y=1|x) and p(y=0|x) for test points.

predict_uq

predict_uq(x_star: Tensor) -> UQResult

Return standardized uncertainty output for binary classification.

GaussianProcessRegressor

Exact GP regression using torch tensors.

fit

fit(x: Tensor, y: Tensor) -> 'GaussianProcessRegressor'

Fit model on training features x and targets y.

log_marginal_likelihood

log_marginal_likelihood() -> float

Return the exact GP log marginal likelihood for fitted data.

posterior_samples

posterior_samples(
    x_star: Tensor, n_samples: int
) -> torch.Tensor

Draw samples from posterior predictive distribution.

predict

predict(
    x_star: Tensor,
    return_cov: bool = False,
    return_var: bool = True,
) -> Tuple[torch.Tensor, torch.Tensor]

Compute posterior predictive mean and variance/covariance.

predict_uq

predict_uq(x_star: Tensor) -> UQResult

Return standardized UQ output for exact GP regression.

HeteroscedasticGaussianProcessRegressor

Two-stage alternating GP that models input-dependent observation noise.

fit

fit(
    x: Tensor, y: Tensor
) -> "HeteroscedasticGaussianProcessRegressor"

Fit mean and log-noise GPs via alternating residual updates.

predict

predict(
    x_star: Tensor,
    return_cov: bool = False,
    include_noise: bool = True,
) -> Tuple[torch.Tensor, torch.Tensor]

Predict mean and variance/covariance at test inputs.

predict_uq

predict_uq(x_star: Tensor) -> UQResult

Return standardized UQ fields for heteroscedastic GP regression.

Kernel

Base kernel interface with composition support.

LinearKernel dataclass

Bases: Kernel

Linear kernel.

MaternKernel dataclass

Bases: Kernel

Matérn kernel with ν in {1.5, 2.5}.

MultiTaskGaussianProcessRegressor

Multi-output GP regression using an intrinsic coregionalization model.

fit

fit(
    x: Tensor, y: Tensor
) -> "MultiTaskGaussianProcessRegressor"

Fit ICM GP on fully-observed multi-output targets y:[N, T].

predict

predict(
    x_star: Tensor,
    return_cov: bool = False,
    include_noise: bool = True,
) -> Tuple[torch.Tensor, torch.Tensor]

Predict per-task means and variances/covariances at x_star.

predict_uq

predict_uq(x_star: Tensor) -> UQResult

Return standardized UQ fields for multi-task GP regression.

OneVsRestGaussianProcessClassifier

Multiclass GP classification via one-vs-rest binary classifiers.

fit

fit(
    x: Tensor, y: Tensor
) -> "OneVsRestGaussianProcessClassifier"

Fit one binary GP classifier per class label.

predict

predict(x_star: Tensor) -> torch.Tensor

Return predicted multiclass labels.

predict_proba

predict_proba(x_star: Tensor) -> torch.Tensor

Return multiclass probabilities by normalized OvR scores.

predict_uq

predict_uq(x_star: Tensor) -> UQResult

Return standardized uncertainty output for multiclass GP classifier.

PeriodicKernel dataclass

Bases: Kernel

Periodic kernel with scalar or ARD lengthscales.

ProductKernel dataclass

Bases: Kernel

Multiplicative kernel composition.

RBFKernel dataclass

Bases: Kernel

Squared exponential (RBF) kernel with scalar or ARD lengthscales.

RationalQuadraticKernel dataclass

Bases: Kernel

Rational Quadratic kernel.

SparseGaussianProcessRegressor

Variational inducing-point GP regression.

Notes
  • By default the class uses an internal trainable RBF kernel (backward compatible behavior).
  • If a fixed kernel is provided, inducing points and noise are still optimized while kernel hyperparameters are treated as fixed.

fit

fit(
    x: Tensor, y: Tensor
) -> "SparseGaussianProcessRegressor"

Optimise sparse variational objective and cache posterior state.

posterior_samples

posterior_samples(
    x_star: Tensor, n_samples: int
) -> torch.Tensor

Draw samples from sparse GP posterior predictive distribution.

predict

predict(
    x_star: Tensor,
    return_cov: bool = False,
    include_noise: bool = True,
) -> Tuple[torch.Tensor, torch.Tensor]

Predict posterior mean and variance/covariance for test inputs.

predict_uq

predict_uq(x_star: Tensor) -> UQResult

Return standardized UQ fields for sparse GP regression.

SpectralMixtureGaussianProcessRegressor

Exact GP regression with a trainable spectral mixture kernel.

fit

fit(
    x: Tensor, y: Tensor
) -> "SpectralMixtureGaussianProcessRegressor"

Fit spectral mixture GP by maximizing log marginal likelihood.

predict

predict(
    x_star: Tensor,
    return_cov: bool = False,
    include_noise: bool = True,
) -> Tuple[torch.Tensor, torch.Tensor]

Predict posterior mean and variance/covariance for test points.

predict_uq

predict_uq(x_star: Tensor) -> UQResult

Return standardized UQ output for spectral mixture GP regression.

SpectralMixtureKernel dataclass

Bases: Kernel

Spectral mixture kernel with fixed mixture parameters.

SumKernel dataclass

Bases: Kernel

Additive kernel composition.