Free tool · no sign-up
Market basket analysis calculator: which dishes are really ordered together
Enter your orders, or paste them, and see which dishes really go together. Market basket analysis scores every pair with Agrawal, Imieliński and Swami’s support and confidence (1993), and with lift, so a drink that is in almost every order doesn’t pass for a pairing.
- No email
- Paste straight from a spreadsheet
- Nothing leaves your browser
Your orders
Or paste from a spreadsheet
Results: all orders
In WalnutPOS
WalnutPOS Insights flags the plainest gap for youInsights reads your paid orders from the last 14 business days and tells you when most orders come without a side or a drink, with a button to create a combo. It works by category, not by pairs of dishes, and doesn’t work out support, confidence or lift; it also can’t export order lines for this calculator yet. It needs 7 trading days and 100 paid orders, and the £0 plan shows one insight in full.£0 plan: 1 location · holds 10 recipes · reports show the last 24 hours · other limits apply. This calculator has no limits and needs no sign-up. See pricing
Method
How each pair is scored
Method: Agrawal, R., Imieliński, T. and Swami, A. (1993), “Mining association rules between sets of items in large databases”, Proceedings of the 1993 ACM SIGMOD International Conference on Management of Data, 207–216, doi:10.1145/170035.170072, for support, confidence and the two minimums. Lift (which they call interest): Brin, S., Motwani, R., Ullman, J. D. and Tsur, S. (1997), “Dynamic itemset counting and implication rules for market basket data”, SIGMOD Record 26(2), 255–264, doi:10.1145/253260.253325. The worked example is from Han, J., Kamber, M. and Pei, J. (2012), Data Mining: Concepts and Techniques, 3rd edn, Morgan Kaufmann, chapter 6. On menus: Ting, Pan and Chou (2010), “Finding ideal menu items assortments: an empirical application of market basket analysis”, Cornell Hospitality Quarterly.
Each rule here has one item on each side (A → B), worked out both ways for every pair ordered together at least once. An item counts once per order, however many of it were in the order. Every comparison is exact; each figure is rounded once, for display. The four groups are this calculator’s, not the papers’: the papers give the measures and the two minimums, not names for what falls short of them.
By Tahseen Dar, founder · Last updated
What to do
What to do with each kind of pair
- Bought togetherMake the pairing easy: a set price for the two, B printed next to A on the menu, or staff offering B with A. Then check the lift again in a month: a good pairing holds.
- Only looks strongLeave it alone. B sells with everything, so a deal on A and B mostly gives money off orders that would have had B anyway. Look for what A lifts instead.
- Rare but linkedTest it cheaply: suggest B to the next people who order A for a week or two. Few orders rest on it, so one busy table can make or break it.
- Not a ruleNo evidence either way yet. If you expected a pairing here, try a lower minimum confidence, or a longer stretch of orders.
About the method
What this method is
Rakesh Agrawal, Tomasz Imieliński and Arun Swami set out association rules in 1993, for shops that wanted to know what their customers bought together. A rule reads “if an order has A, it also has B”, written A → B, and comes with two measures.
Support is the share of all orders that have both A and B: how much of your trade the rule rests on. Confidence is the share of A’s orders that also have B: how often the rule holds. A rule counts when both reach the minimums you set.
Lift, added by Brin, Motwani, Ullman and Tsur in 1997, compares that confidence with how common B is anyway. Above 1, B turns up with A more than with orders in general; at 1 or below, A tells you nothing about B, however high the confidence.
Reading the results
How to read it
In the example, 83.7% of cheeseburger orders have fries, against 44.9% of all orders: lift 1.87, bought together. 58.1% of cheeseburger orders have a soft drink, but 64.7% of all orders do: lift 0.90, so the pairing only looks strong.
A → B and B → A share their support and lift but not their confidence: most cheesecake orders have pasta carbonara (65.2%), but few carbonara orders have cheesecake.
Support tells you how many orders a rule rests on. Cheesecake → pasta carbonara has a lift of 5.36 but only 15 orders behind it (2.6%), so it is rare but linked: worth a test, not a new menu.
The minimums are yours to set. Lower them for a short list of orders, raise them when you have thousands; the groups move, the measures don’t.
Compared
How it differs from a best-sellers list
| Compared on | Market basket analysis | A best-sellers list |
|---|---|---|
| Looks at | Which items are in the same order | How many of each item sold |
| Answers | What to pair, bundle or suggest | What sells most |
| Popular items | Lift allows for them: a drink in most orders isn’t a pairing | Always at the top |
| Needs | Each order’s items | Item totals |
Han, Kamber and Pei’s own example: of 10,000 transactions, 6,000 include computer games, 7,500 videos and 4,000 both. Games → videos has 40% support and 66.7% confidence, yet its lift is 0.89: people who buy games buy videos less often than everyone else. Counting sales alone can’t show that; lift can.
Worked example
The textbook’s nine transactions, pair by pair
Table 6.1 of Han, Kamber and Pei (Data Mining: Concepts and Techniques, 3rd edn, 2012, chapter 6): nine transactions of five items, I1 to I5, with the book’s minimum support of 2 transactions (22%) and a minimum confidence of 70%. The transactions: {I1, I2, I5}, {I2, I4}, {I2, I3}, {I1, I2, I4}, {I1, I3}, {I2, I3}, {I1, I3}, {I1, I2, I3, I5}, {I1, I2, I3}.
| If it has (A) | It also has (B) | Both | Support | Confidence | Lift | Result |
|---|---|---|---|---|---|---|
| I5 | I1 | 2 | 22.2% | 100.0% | 1.50 | Bought together |
| I4 | I2 | 2 | 22.2% | 100.0% | 1.29 | Bought together |
| I5 | I2 | 2 | 22.2% | 100.0% | 1.29 | Bought together |
| I1 | I5 | 2 | 22.2% | 33.3% | 1.50 | Not a rule |
| I2 | I4 | 2 | 22.2% | 28.6% | 1.29 | Not a rule |
| I2 | I5 | 2 | 22.2% | 28.6% | 1.29 | Not a rule |
| I1 | I3 | 4 | 44.4% | 66.7% | 1.00 | Not a rule |
| I3 | I1 | 4 | 44.4% | 66.7% | 1.00 | Not a rule |
| I1 | I2 | 4 | 44.4% | 66.7% | 0.86 | Not a rule |
| I3 | I2 | 4 | 44.4% | 66.7% | 0.86 | Not a rule |
| I2 | I1 | 4 | 44.4% | 57.1% | 0.86 | Not a rule |
| I2 | I3 | 4 | 44.4% | 57.1% | 0.86 | Not a rule |
| I4 | I1 | 1 | 11.1% | 50.0% | 0.75 | Not a rule |
| I5 | I3 | 1 | 11.1% | 50.0% | 0.75 | Not a rule |
| I1 | I4 | 1 | 11.1% | 16.7% | 0.75 | Not a rule |
| I3 | I5 | 1 | 11.1% | 16.7% | 0.75 | Not a rule |
Three rules pass, all with lift above 1: I5 → I1 (lift 1.50), I4 → I2 and I5 → I2 (1.29). Each rests on 2 of the 9 transactions, and every transaction with I4 or I5 also has the item on the right.
I1 and I2 are together most often (4 of 9 transactions), but only 66.7% of I1’s transactions have I2, under the 70% bar, and I2 → I1 is 57.1%. The book goes on to rules with two items on one side, such as {I1, I5} → I2; this calculator stops at one item each side, which is where a menu’s pairings sit.
Questions
Market basket analysis, answered
What do I type for each order?
The items in it, separated by commas, and how many orders were exactly like it (leave it blank for 1). You can also paste one line per item with its order number, from a till or delivery-app export, and the calculator puts each order together.
What minimums should I use?
There is no right figure. The example uses 5% support and 50% confidence. With a few hundred orders, lower support finds more pairs but more of them are chance; with thousands, you can raise both. Watch the lift either way.
Why isn’t a drink with everything “bought together”?
Because it would be in those orders anyway. Lift compares how often B comes with A with how often B comes at all. A drink in two orders out of three needs to be in more than two-thirds of A’s orders to show lift above 1.
Is A → B the same as B → A?
They share support and lift, but not confidence. Most cheesecake orders in the example have carbonara, but few carbonara orders have cheesecake, so suggesting cheesecake to carbonara eaters is a weaker bet than the other way round.
Does it look at three items together?
Not here. Each rule has one item on each side, which is where menu pairings sit. The original method also finds rules such as {burger, fries} → milkshake, which need many more orders to be worth trusting.
Is anything I type saved?
No. Everything is worked out in your browser and nothing is sent to us. Download the CSV to keep the results, or use "Copy link": your orders go in the link itself, and we don't store them.
Get these numbers from your real orders
WalnutPOS records every order and every kitchen ticket as you trade, and the customers you add to them. Start on the £0 plan, or WhatsApp us and we'll help.
£0 plan: 1 location · reports show the last 24 hours · other limits apply. See every limit
