IGaussianProcessClassifier<T>

Interfaces · AiDotNet.Interfaces

Defines an interface for Gaussian Process classification, a probabilistic approach to classification that provides uncertainty estimates along with class predictions.

Known implementations: GaussianProcessClassifier<T>

For Beginners

Gaussian Process Classification (GPC) is a powerful method that combines the flexibility of Gaussian Processes with classification tasks.

Unlike regular classifiers that just say “this is class A,” a GP classifier tells you:

  • “This is probably class A (90% confident)”
  • “This might be class A or B (60%/40% split)”

This is incredibly useful when:

  • You need to know how confident the model is in its predictions
  • You want to identify ambiguous cases that might need human review
  • Your data has complex, non-linear patterns
  • You have limited training data but need reliable predictions

The GP classifier works by:

  1. Learning a latent (hidden) function over your input space
  2. Passing this function through a link function (like sigmoid) to get probabilities
  3. Using approximation techniques (like Laplace) to handle the non-Gaussian likelihood

Key differences from GP regression:

  • Regression predicts continuous values; classification predicts discrete labels
  • Classification requires a link function to convert latent values to probabilities
  • The posterior is not analytically tractable, requiring approximation methods

Properties

Property Summary
int NumClasses { get; } Gets the number of classes learned during training.

Methods

Method Summary
Matrix<T> PredictProbabilities(Matrix<T> X) Predicts class probabilities for multiple input points.
T GetLogMarginalLikelihood() Gets the log marginal likelihood of the model, useful for hyperparameter optimization.
ValueTuple<int, T, T> Predict(Vector<T> x) Predicts the class probabilities for a new input point.
void Fit(Matrix<T> X, Vector<T> y) Trains the Gaussian Process classifier on labeled training data.
void UpdateKernel(IKernelFunction<T> kernel) Updates the kernel function used by the classifier.