Definition
To focus more on the top of the ranked list, where the top
positions are those we care about using the precision at
measure, one can weigh the pairwise violations depending on their position in the ranked list. For pair-wise learning procedure, we construct a set of all positive labelled instances, denoted as
and a set of negative labelled instances as
. The loss is defined as:
(1) ![]()
where
(2) ![]()
where
(3) 
Different choices of
- For
for all
we have the same AUC optimization as margin ranking criterion. - For
and
the precision at
is optimized. - For
and
the precision at
is optimized. - For
a smooth weighting over positions is given, where most weight is given to the top position, with rapidly decaying weight for lower positions. This is useful when one wants to optimize precision at
for a variety of different values of
at once.
The loss discussed above is also equal to:
(4) ![Rendered by QuickLaTeX.com \begin{align*} \mbox{err}_{\mbox{WARP}}(\mathbf{x}_{i}, y_{i}) &= L[rank(f(y_{i} \, | \, \mathbf{x}_{i}))] \times 1\nonumber \\ &= \frac{L[rank(f(y_{i} \, | \, \mathbf{x}_{i}))] \sum_{(\mathbf{x}^{\prime}, y^{\prime}) \in \mathcal{C}_{u}^{-}} \mathbb{I}[f(y^{\prime} \, | \, \mathbf{x}^{\prime}) \geq f(\mathbf{x}_{i})]}{rank(f(\mathbf{x}_{i}))} \nonumber \\ &= \sum_{(\mathbf{x}^{\prime}, y^{\prime}) \in \mathcal{C}_{u}^{-}} \frac{L[rank(f(y_{i} \, | \, \mathbf{x}_{i}))] \mathbb{I}[f(y^{\prime} \, | \, \mathbf{x}^{\prime}) \geq f(\mathbf{x}_{i})]}{rank(f(y_{i} \, | \, \mathbf{x}_{i}))} \end{align*}](https://www.hongliangjie.com/wp-content/ql-cache/quicklatex.com-0f6321c3d9e0850a0e0068f57108e122_l3.png)
with the convention
(5) ![]()
Due to the discrete nature of identity functions, we can always replace them with hinge loss:
(6) ![]()
Online Learning to Rank
The overall risk we want to minimize is:
(7) ![]()
An unbiased estimator of this risk can be obtained by stochastically sampling in the following way:
- Sample a positive pair
according to
. - For the chosen
sample a negative instance
such that
.
This chosen negative instance as well as the positive instance has the contribution:
(8) ![]()
For large dataset, the stochastic optimization steps discussed above is inefficient:
- In step (2) above, we need to compute
for all possible negative instances. - In single contribution 8, we need to calculate
function, which also requires to compute
for negative instances.
Some approximation can be used. For step (2), we can sample labels with replacement until we find a violating label.
Now if there are
violating labels, we use random variable
to denote the number of trials in the sampling step to essentially obtain an violating label. This random variable follows a geometric distribution of parameter as (here, the assumption is that the probability to sample the first negative label equals the probability to sample a negative label):
(9) ![]()
where
(10) ![]()
References:
[1] Jason Weston, Samy Bengio, and Nicolas Usunier. Large scale image annotation: learning to rank with joint word-image embeddings. Machine Learning, 81(1):21–35, October 2010.
[2] Nicolas Usunier, David Buffoni, and Patrick Gallinari. Ranking with ordered weighted pairwise classification. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pages 1057–1064, New York, NY, USA, 2009. ACM.