Problem
A team has two ranking models for a recommendation feed or product search and must decide which one goes into an A/B test. Accuracy, precision, recall and ROC AUC ignore the order of items and treat relevance as yes or no. Such a model scores the same whether the ordered item sits at position 1 or 8, although users act mostly on the top results.
Example from the article: a user searches "blue jeans" and interacts with ten items. They click the third, share the fourth, add the eighth to the cart and order the seventh. Two models rank these ten items differently, and the team wants to know which order is better.
Solution in brief
Give every interaction type a graded relevance score. Compute NDCG@K: the position-discounted sum of relevance in the model's order, divided by the same sum for the ideal order. Average it over test sessions. K, the relevance scale and the discount are set to match how users browse the product.
Questions this case answers
- How to compare ranked lists offline when users act on the top positions more than on the rest and feedback comes in several strengths rather than yes or no
- How to monitor the quality of a deployed ranking model from logged user feedback without running a new experiment
- How to compare two ranking models offline before launching an A/B test?
- How to turn clicks, carts and orders into graded relevance scores for a ranking metric?
Tools and methods
- Graded relevance from interactions — maps order, add-to-cart, share, click and view to scores 4, 3, 2, 1 and 0
- DCG and IDCG — position-discounted gain of the model's order and of the ideal order
- NDCG@K — DCG divided by IDCG, comparable across lists
- MRR and Precision@K — alternatives when only the top one or two positions matter
Google or a one-time email code. No password.