BernoulliLikelihood<T>

Models & Types · AiDotNet.GaussianProcesses

Implements the Bernoulli likelihood for binary classification.

Implements: ILikelihood<T>

For Beginners

The Bernoulli likelihood is used for binary classification (yes/no, 0/1, positive/negative outcomes).

The latent function f is passed through a sigmoid to get probability: p(y=1|f) = σ(f) = 1 / (1 + exp(-f))

This means:

  • f → +∞ gives p(y=1) → 1
  • f → -∞ gives p(y=1) → 0
  • f = 0 gives p(y=1) = 0.5

The GP models uncertainty in f, which translates to uncertainty in class probabilities.

Note: Bernoulli likelihood requires approximate inference (Laplace or EP).

Constructors

Constructor Summary
BernoulliLikelihood() Initializes a new Bernoulli likelihood.

Properties

Property Summary
string Name { get; } Gets the name of this likelihood.

Methods

Method Summary
T LogLikelihood(Vector<T> y, Vector<T> f) Computes the log-likelihood of observations given latent function values.
T PredictiveVariance(T fMean, T fVariance) Computes predictive variance for classification probabilities.
T TransformMean(T f) Transforms latent function value to class probability using sigmoid.
Vector<T> LogLikelihoodGradient(Vector<T> y, Vector<T> f) Computes the gradient of the log-likelihood with respect to f.
Vector<T> LogLikelihoodHessianDiag(Vector<T> y, Vector<T> f) Computes the Hessian diagonal of the log-likelihood.