Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Market Basket Analysis Without the Beer and Nappies Myth
AI & Machine Learning

Market Basket Analysis Without the Beer and Nappies Myth

Association rules find products bought together, but most of what they surface is obvious or coincidental. How to separate a useful rule from a popular one.

Updated 2 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

Association rules are easy to generate and easy to misread. Support, confidence and lift each answer a different question, and a rule with high confidence but lift near one is telling you only that the product is popular. Test any rule with a controlled change before rebuilding a category.

What the technique actually does

Market basket analysis looks across transactions and finds combinations that occur together more than chance would suggest. The output is a set of rules: customers who buy A also tend to buy B.

It is genuinely useful for cross-sell prompts, bundle design, range decisions and store layout. It is also the source of a great deal of confident nonsense, because the raw output rewards popularity rather than insight.

Three numbers, three different questions

MeasureQuestion it answersTrap
SupportHow often does this combination occur at all?High support favours common items regardless of relationship
ConfidenceGiven A, how often does B appear?High if B is simply popular, with no real link
LiftDoes A make B more likely than baseline?Can be high on tiny, unstable samples

Illustrative arithmetic: if 60% of all baskets contain milk, then a rule 'bread implies milk' with 62% confidence looks strong but has a lift of about 1.03 - essentially no relationship. Confidence alone would have promoted it.

Use lift to find real association and support to check the rule occurs often enough to be worth acting on. A rule with excellent lift appearing in a handful of baskets is noise.

Association is not a reason to act

Even a statistically sound rule may be commercially useless. Products bought together because customers were always going to buy both do not need a bundle - discounting them gives away margin on a sale you had.

The commercially interesting rules are the ones where a prompt changes behaviour. That is a different question from co-occurrence, and the only reliable way to answer it is to try the change on part of the traffic and compare.

  • Obvious pairs - razor and blades. Already happening; little to gain.
  • Seasonal artefacts - two items sold together in December only. Check the rule across time before acting.
  • Promotion echoes - the pair was on a shared offer. The rule describes your past marketing, not customer preference.
  • Genuinely surprising, repeated across periods - worth a controlled test.

Practical uses that tend to pay

In our experience the reliable wins are less glamorous than the case studies suggest: identifying products that should not be out of stock together, spotting range gaps where a complement is missing, and informing which item to show in a basket prompt rather than choosing it by margin alone.

Store and site layout changes are harder to evaluate and slower to reverse, so they warrant a stronger evidence bar than a recommendation widget that can be switched off in an afternoon.

A rule that says customers buy two popular things together has told you they are popular.

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

How many transactions do I need?

Enough that the specific combinations you care about appear regularly, not just the overall total. Rare pairs need far more data than common ones.

Is this the same as a recommendation engine?

Related but different. Association rules describe baskets in aggregate; a recommender personalises to an individual and usually uses more signals.

Should I bundle every high-lift pair?

No. Bundling something customers already buy together gives away margin. Test whether the prompt changes behaviour first.

Do I need machine learning for this?

Not necessarily. Association rule mining is a well-established technique that runs on transaction data without a trained model.

Keep reading

More on AI & Machine Learning

Start here

Want machine learning project details from us?

Tell us what you are trying to predict and roughly what data you hold. We will come back with an honest view on whether machine learning is the right tool, what the work would involve and a realistic cost range. If a spreadsheet would do the job, we will say so.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →