All use casesApproval DeskCustomer LifecycleOperations AssistantTransaction ReviewReorder Ranking
built by giggit · reorder ranking

Order the Cart By What They'll Buy Again

A ranking model that orders each shopper's past products by how likely they are to be bought again, built on the full Instacart dataset. Every feature comes from before the order it predicts, so the ranking is one a live app could actually show.

Every number on this page is copied from the pipeline's own metrics file 3,421,083 real orders · 206,209 shoppers

How It Works

  1. The candidate set for each shopper is every product they bought in an earlier order, not the whole catalog.
  2. Every feature is past-only: how often they've bought it, how long since, where it sits in their cart, nothing from the order being predicted.
  3. A LightGBM lambdarank model, grouped by shopper, learns to put the products they'll buy again near the top.
  4. It is evaluated on shoppers held out of training, ranked against what they actually bought next.

Results

MetricLambdarankBuy-It-Again Baseline
NDCG@100.5490.501
NDCG@200.6050.557
Recall@1057.8%52.5%
Recall@2075.5%70.2%

Measured on 12,231 shoppers held out of training (890 more were excluded for having no candidate product they went on to reorder). The baseline ranks by how often a product was bought before; lambdarank beats it on every metric, most on NDCG@10.

Orders
3,421,083
Order Lines
33,819,106
Shoppers
206,209
Products
49,688

A separate check asked whether 30 days of early activity predicts a shopper's activity over the following year. On the 157 shoppers held out for that check, a small model built on 30-day features does not beat simply using the raw 30-day order count (Spearman 0.703 against 0.714 for the naive count). Reported as measured, not tuned away.

Rank a Shopper

Pick a real holdout shopper and rank their past products against the live model.

Shoppers are real holdout users the model never trained on. Ranking runs against the live model API.

Code

The model, the training pipeline, and the scoring service: github.com/alphan-ml/reorder-radar

What It Does

The Candidate Set Is Real

The model only ever ranks products the shopper has actually bought before. It is not guessing from the whole catalog, it is ordering what's already in their history.

Nothing From the Future Leaks In

Every feature is built from orders before the one being predicted. The ranking is one a live app could show before that order happens, not after.

It Beats Buying By Habit

Ranking by frequency alone is a strong baseline. The model beats it on every metric measured, most on the top of the list, where the ranking matters most.

How It Was Built

1 CLIENT SIDE Order History 3.4M orders, 206,209 shoppers, every product bought 2 GIGGIT BUILT Candidate Table Shopper × product, past-only features, labeled by the next order 3 GIGGIT BUILT Lambdarank Model Grouped by shopper, evaluated on shoppers held out of training 4 OWNER KEEPS The Cart Order Where the ranking shows up, and what happens with a miss
Client sideOrder history3.4M orders, 206,209 shoppers, every product bought
Giggit builtCandidate tableShopper × product, past-only features, labeled by the next order
Giggit builtLambdarank modelGrouped by shopper, evaluated on shoppers held out of training
Stays with the ownerThe cart orderWhere the ranking shows up, and what happens with a miss