Preference learning#

Preference learning and aggregation.

Bradley-Terry models, Gaussian-process preference learning and rank aggregation.

Classes#

PreferenceModel()

Interface of preference models.

LinearBT([alpha, iters])

Bradley–Terry model with a linear utility \(u(\mathbf x)=\mathbf w^\top\mathbf x\).

KernelBT([n_features, lengthscale, alpha, seed])

Nonlinear Bradley–Terry model on random Fourier features (Rahimi and Recht, 2007).

GPPreference([lengthscale, signal, noise, ...])

Gaussian-process preference learning with a probit likelihood (Chu and Ghahramani, 2005).

Functions#

dataset_from_log(log, vectorize)

Item matrix and index pairs from a SessionLog.

pairs_to_arrays(pairs, m)

Pairs → (winner idx, loser idx, weights) arrays, dropping self-pairs.

bt_scores(pairs, items[, prior, iters, tol])

Bradley–Terry strengths by the MM algorithm (Hunter, 2004).

copeland(pairs, items)

Copeland score: wins minus losses of pairwise majority contests.

borda(rankings, items)

Borda count of (possibly partial) rankings; unranked items share the remaining points.

kemeny(rankings, items[, exact_max])

Kemeny–Young consensus ranking (exact up to exact_max items, else Borda + local search).

elo(pairs, items[, k, base])

Sequential Elo ratings (Elo, 1978) in the order the comparisons were made.

aggregate_rankings(rankings, items[, ...])

Consensus order of several rankings (borda, kemeny, bt, copeland).

win_matrix(pairs, items)

W[i, j] = total weight of items[i] beating items[j].

cyclic_triads(pairs, items)

Number of intransitive (cyclic) triads and Kendall–Babington Smith consistency ζ.