Skip to content
mlmentorship

Design a complementary purchase shelf

Distinguish complements from similarity, compare co-purchase rates with lift, and separate attributed orders from useful incremental purchases.

Published · 6 min read ·Role-specific ·Advanced

ML breadth · active recall

Practice before you read

8 minutes. Explain the mechanism, why it works, when it fails, and one alternative.

ML breadth · closed-book attempt

Design a complementary purchase shelf

Explain the mechanism, why it works, when it fails, and one alternative.

Problem

Context. A shopper has selected a printer, and the hypothetical store has basket co-occurrence counts for possible add-ons. Task. Compare the evidence below, propose candidate retrieval and ranking, and define an experiment for useful purchase effects. Explain how compatibility, eligibility, and the shelf's purpose affect selection. Constraints. Observed co-purchases are associations, not proof that showing an item causes incremental value. Account for item popularity, exposure, and substitutes; this is not a claim about Amazon's internal implementation. Build an illustrative complementary shelf, not a claim about current Amazon internals. In 1,000 fictional baskets, 100 contain the printer, 80 contain ink and 50 contain both. Another add-on appears in 300 baskets and 60 printer baskets. Which evidence should retrieve candidates, and how would you measure useful purchase effects?

08:00recommended time

Closing or reloading clears the scratchpad. Only score, weak rubric dimensions, attempt count, and retry date can be stored locally.

Reading depth

Design a complementary-product shelf and distinguish useful add-ons from substitutes or merely popular items.

Problem

Context. A shopper has selected a printer, and the hypothetical store has basket co-occurrence counts for possible add-ons.

Task. Compare the evidence below, propose candidate retrieval and ranking, and define an experiment for useful purchase effects. Explain how compatibility, eligibility, and the shelf’s purpose affect selection.

Constraints. Observed co-purchases are associations, not proof that showing an item causes incremental value. Account for item popularity, exposure, and substitutes; this is not a claim about Amazon’s internal implementation.

Build an illustrative complementary shelf, not a claim about current Amazon internals. In 1,000 fictional baskets, 100 contain the printer, 80 contain ink and 50 contain both. Another add-on appears in 300 baskets and 60 printer baskets. Which evidence should retrieve candidates, and how would you measure useful purchase effects?

Picture: Hold the Printer Fixed

Co-purchase suggests a candidate; product fit establishes a complement

Co-purchase evidence does not establish product compatibilityA frequently co-purchased case can still fail the phone fit requirement. Complementarity needs a separate compatibility relation.Every required gate must pass on thesame route+co-buyxfits phoneHigh co-buy case A fails fit and isexcluded.+co-buy+fits phoneLower co-buy case B is compatible andeligible.
Derivation
An ink association becomes a complement only after product-fit verificationA toy printer P1 is the fixed purchase anchor. Co-purchase links ink C7 with a count of fifty baskets and no known denominator. Co-view links another printer P2; attributes link similar printer P3. Only verified C7-to-P1 compatibility can admit ink to the complementary shelf.Anchor printer P1task: completepurchaseCo-purchaseink C750 basketsdenominatorunknownCo-viewprinter P2possiblealternativeAttributesprinter P3similarfeaturesDoes current catalog verify C7 fits P1?YES: complementary shelfNO / UNKNOWN: withhold C7Observed association is not productcompatibility.P2 and P3 answer a different comparison task.
Each edge names a different relation to P1. Fifty baskets is a count, not a rate. Verify C7 fits P1 before treating it as a complementary purchase.
Check: Which candidate could complete this purchase? What must be verified beyond observing co-purchase?
Read it this way: A frequently co-purchased case can still fail the phone fit requirement. Complementarity needs a separate compatibility relation.
Can the more frequently co-purchased case be eligible if it does not fit?

Calculate Two Different Associations

Define one basket and one observation window; count each item once per basket here. The conditional rate divides joint baskets by printer baskets. Lift divides that rate by the candidate’s overall basket rate.

CandidateJoint basketsConditional rateOverall rateLift
Ink5050/100 = 0.5080/1,000 = 0.086.25
Popular add-on6060/100 = 0.60300/1,000 = 0.302.00

Counts and lift disagree on order. Neither proves compatibility, reliable confidence or incremental customer value.

Decision: Retrieve, Check Fit, Then Rank

Union decayed item-pair candidates with content-based cold-item candidates. Apply current stock, region, device compatibility and customer-state rules before display. Predict declared click/cart/purchase/return outcomes for the anchor, candidate, customer and context. Loss weights are not automatically calibrated product utility.

Change 1: Help Compare Printers

New task. The shopper has not selected a printer.

Picture and change. Retrieve substitutes and compare useful attributes, rather than optimize complementary attach rate.

Check. Ink need not help this decision.

Use when. The surface’s purpose changes.

Change 2: The Customer Already Bought Ink

New task. Support replenishment, not permanent exclusion.

Picture and change. Use category, recency, purchase/cart state and exact consumable compatibility.

Check. A prior ink purchase is not a universal reason to suppress another.

Use when. Repeat purchases are legitimate.

Failure: Similarity Is Called Useful Incremental Revenue

Cosine-near printers can crowd out compatible ink. Last-touch purchases are observable attribution, not purchases caused by the shelf.

Transfer Check

Does high co-purchase lift prove displaying the pair causes more useful purchases?

Reasoned Answer

No. Identify the display effect through a valid design, with return maturity and customer outcomes.

Observation, Decay and Evaluation

Recommendations change tomorrow’s co-purchase data. Log source, candidates, versions, propensity where known, position, actual exposure and mature outcomes. Randomized eligible exposure/positions can identify specific effects under their assumptions; position features alone do not remove selection. Other causal designs require explicit identification assumptions and support.

Decay an event aged days with for half-life . At , its weight is 0.5, not zero. Choose decay by category and validate sparse-pair uncertainty; do not impose arbitrary popularity penalties or broad cold-item boosts.

Offline held-out pairs test association prediction, not causal basket lift. Online assignment must match the estimand and cover returns, satisfaction, long-term value and displacement. Keep attribution separate from randomized or otherwise identified incremental effects.

Customer-state caches need identity, freshness and invalidation contracts; recheck current exclusions. Durable purchases may warrant exclusion, whereas consumables need replenishment rules. Views and cart state are not interchangeable with purchases.


Related: Design YouTube’s recommender, Two-tower vs cross-encoder: when to use which?, System design case study: personalized search ranking.