Prompt
Cross-sell recommendation model for cart page
Latest observation
For a cart page cross-sell recommendation model, the goal is to suggest a small number of relevant add-on products that increase basket value without distracting the shopper.
1) Define the objective
Typical business goals:
- Increase AOV (average order value)
- Increase attach rate for complementary items
- Maintain or improve conversion rate
- Avoid recommending items that conflict with cart contents
2) Recommendation strategy
A strong cart-page model is usually a hybrid recommender:
A. Item-to-item similarity
Recommend products frequently purchased together with items in the cart.
- Example: cart has a coffee machine → recommend filters, pods, descaler
B. Association / market-basket rules
Use co-occurrence signals from historical orders.
- Metrics: support, confidence, lift
- Good for complementary items
C. Content-based matching
Use product metadata:
- category
- brand
- price band
- compatibility
- attributes like size, color, device model
D. Collaborative filtering
Use user and order interaction patterns:
- “users who bought this also bought…”
- Useful when basket is sparse or product graph is rich
E. Context-aware ranking
Re-rank candidates using cart context:
- price sensitivity
- margin
- inventory
- seasonality
- user segment
- device type
3) Candidate generation
Generate maybe 50–200 candidates from:
- co-purchase graph
- item embeddings
- category rules
- “frequently bought together”
- accessories by parent product
- popular items in user’s region or segment
4) Ranking features
Common features for a ranking model:
- overlap with cart categories
- co-purchase count
- lift/confidence
- item similarity score
- price ratio vs cart value
- margin
- discount relevance
- inventory availability
- brand affinity
- user affinity to category/brand
- novelty/diversity penalty
- compatibility score
- delivery time
5) Model choices
Depending on maturity:
Simple baseline
- Rule-based “frequently bought together”
- Good starting point and easy to explain
Learning-to-rank
- XGBoost / LightGBM ranker
- Train on historical carts with purchased vs not purchased candidates
Deep retrieval + ranking
- Two-tower retrieval model for candidates
- Ranker for final ordering
- Best at scale
6) Training labels
Possible positive labels:
- item added from cart-page recommendation
- item purchased in same session after cart view
- item purchased together in same order
Negative labels:
- shown but not clicked/purchased
- sampled items not purchased with similar carts
Watch out for exposure bias: only items shown can be negatives if you have impression logs.
7) Evaluation
Offline metrics:
- Recall@K
- NDCG@K
- MAP@K
- Hit Rate
- Lift vs baseline
Business metrics:
- attach rate
- incremental revenue
- AOV uplift
- conversion impact
- revenue per impression
- margin per impression
Use A/B testing for final validation.
8) UX recommendations
Cart page usually works best with:
- 2–5 recommendations max
- “Frequently bought together” or “Complete your purchase”
- clear relevance explanation
- avoid competing with the main purchase
- show accessories/consumables first
- enforce diversity and avoid duplicates
9) Practical rules
Good cart-page constraints:
- exclude items already in cart
- exclude out-of-stock items
- exclude low-margin or highly substitutable items if they hurt conversion
- avoid recommending items above a large price threshold unless justified
- cap by category diversity
- prefer accessories, consumables, warranties, add-ons
10) Example architecture
- Build item co-purchase graph from order history
- Generate candidates from cart items
- Add content-based and collaborative candidates
- Score using ranker
- Apply business rules
- Return top N recommendations
If you want, I can also provide:
- a system design for this model
- a feature list + training schema
- a Python/SQL example
- or a LightGBM ranking pipeline for cart-page recommendations.