Problem
A fashion marketplace has more than 600,000 items in stock, and 95% of users never look past the first 120 cards. The catalog was ranked per user segment, so everyone in a segment saw the same order. Scoring the whole catalog per user with a heavy model is too expensive. The team had to personalize only the top of the list and stay within a tight response-time budget.
Example from the article: for a user who likes black clothing, long skirts and the Zarina brand, most of those items would not have reached the top 500 under segment ranking alone.
Solution in brief
Ranking is split into two stages. Stage one is one Elasticsearch query that adds a per-user boost (user attribute preferences times logistic-regression weights) to the segment score and returns the top 300 items. Stage two is a separate Go service that re-ranks those 300 with a CatBoost model (YetiRank loss), retrained daily. Only stage two improved business metrics in A/B tests.
Questions this case answers
- How to personalize the ordering of a large item catalog per user when scoring every item with a heavy model at request time is too expensive
- How to combine a precomputed segment-level relevance score with per-user attribute preferences in a single retrieval query
- How to personalize the ranking of a catalog with hundreds of thousands of items for every user without scoring the whole catalog per request
- How to add user attribute preferences to an Elasticsearch ranking score and choose the weight of each attribute
Tools and methods
- Elasticsearch function_score — filters items and adds the personal boost to the segment score
- Logistic regression — learns how much each attribute preference should weigh in the boost
- CatBoost (YetiRank) — second-level re-ranker over the top 300 candidates
- Apache Spark and Hadoop — daily feature, dataset and training jobs
- Aerospike — online store for user and item features
- SHAP — feature importance of the trained re-ranker
Google or a one-time email code. No password.