liveBook · Manning

Pairwise comparison dataset

As explained in Bayesian Optimization in Action

A pairwise comparison dataset is a collection of outcomes indicating which member of each pair of alternatives was preferred.

A pairwise comparison dataset records which of two alternatives a user prefers. It suits recommendation and preference optimization when choosing between items is easier and more consistent than assigning numerical ratings. section 10.5

Each comparison is represented by a two-element tensor of indices: the first identifies the preferred point in train_x, and the second identifies the non-preferred point. The dataset therefore stores relative outcomes rather than numerical objective values. section 10.2 section 10.5

Encoding two preferences

Suppose a user prefers x = 0 to x = 3 and x = 0 to x = −4. With train_x = [0, 3, −4], train_comp is [[0, 1], [0, 2]]: point 0 wins against points 1 and 2. A helper such as compare() returns [0, 1] when the first objective value is greater, and [1, 0] otherwise. section 10.2

A pairwise comparison dataset can be used to:

  • Train a Gaussian process by maximizing the likelihood of observed comparisons. section 10.5
  • Represent preferred locations with greater predicted means than locations judged inferior. section 10.5
  • Guide Bayesian optimization by comparing the best observed point with a newly recommended candidate. section 10.5
Figure 10.4 Searching for the shirt with the optimal number of flowers in a product recommendation problem. Our search space is one-dimensional since we only search for the number of flowers on a shirt. A shirt that’s more than half covered in flowers is a local optimum, while a shirt that’s almost fully covered maximizes the user’s preference.

Visualizes a one-dimensional preference search in which a product attribute has both a local optimum and a global optimum. section 10.2

How Bayesian Optimization in Action covers it

How deep it goes
Defines indexed tensor encoding, demonstrates construction, and connects the data to Gaussian-process and Bayesian-optimization behavior.
Examples
Uses comparisons among 0, 3, and −4, plus a one-dimensional shirt-design recommendation search.
What it assumes
Assumes objective evaluations or user preferences and basic indexed tensors; teaches the pairwise encoding explicitly.
What you can do after
Build it from scratch by storing queried points and encoding each preference as preferred and non-preferred indices.
How it connects
Connects preference optimization with Gaussian processes, Bayesian optimization, expected improvement, and numerical evaluation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bayesian Optimization in Action. The section links point to the parts of the book it draws on.