PairwiseLaplaceMarginalLogLikelihood trains a Gaussian-process model when observations record preferences rather than real-valued measurements. It supplies the likelihood computation required by BoTorch’s PairwiseGP, allowing hyperparameters such as length scale and output scale to be fitted to comparison data. section 10.3
from botorch.models.pairwise_gp import PairwiseGP, #1 PairwiseLaplaceMarginalLogLikelihood #1 from botorch.fit import fit_gpytorch_mll #1 model = PairwiseGP(train_x, train_comp) #2 model.covar_module.raw_outputscale.requires_grad_(False) #3 mll = PairwiseLaplaceMarginalLogLikelihood(model) #4 fit_gpytorch_mll(mll); #5
Create a PairwiseGP, construct its pairwise marginal log likelihood, and fit the model with BoTorch. Fixing output scale is optional and supports visualization. section 10.3
Fitting comparisons
For comparisons such as [0, 1], [0, 2], and [3, 0], PairwiseGP and PairwiseLaplaceMarginalLogLikelihood can be passed to fit_gpytorch_mll. The resulting posterior mean reflects the observed preferences, while uncertainty decreases around compared training points without necessarily reaching zero.
