A corner shop logged 40 baskets: which of ten products (bread, milk, eggs, butter, cereal, coffee, sugar, bananas, bacon and jam) each customer bought. The owner wants to rearrange the shelves and run a bundle offer, and asks which items go together.
"Bread and milk are often bought together" is true and useless if almost everyone buys bread. Association rules measure three things: support (how often the pair occurs), confidence (how often the second item follows the first) and lift (how much more often than if the two were unrelated). You will mine the rules, read them by lift rather than by count, and give the owner a page to look at. With only 40 baskets, every rule is a lead to test, not a finding. The baskets were written by hand for illustration.
Data: Forty shopping baskets (illustrative) · Simulated. CodeSplash parity fixture ml_baskets (40 shopping baskets written for the tests).
Discover starts from the question. "Which items appear together?" leads to association rules, with support, confidence and lift for every rule above the thresholds. Then read them by lift: near 1 means chance, well above 1 is a real pull, and a high lift on two baskets is a curiosity.
Which rule would you act on, and how many of the 40 baskets back it?
Open Discover in the sidebar.
Choose Co-occurring items.
Choose ml_baskets (sample) as the data.
Press the Association rules card.
Make sure Items holds the ten product columns, one true or false column per product, and leave out basket.
Press Run.
Read the rules table and sort it by lift. Which pairs pull together most?Counts favor popular items. Lift corrects for popularity, which is what a bundle offer needs.
Pick the one rule you would act on, and note its support, confidence and lift.
Stage 2 · dashboards · ~10 min
Give the owner a page
Put the rules where the owner will look: a dashboard with the basket data and the rules from your run.
Open Dashboards, press the plus button and choose Blank dashboard.
Press Add a data source, choose ml_baskets (sample) and press Add source.
Close the dialog and press Table, to show the baskets.
Press Add widget and choose Analysis result, then pick your association-rules run in the panel on the right.
Press Present.
Hints
The baskets are in wide form, one true or false column per product, so they go in Items.
Read lift before counts. Popular items co-occur often without pulling on each other.
With 40 baskets, treat each rule as a lead to test with a shelf change or an offer, not as a finding.
dashboard
A shelf and bundle recommendation
Recommend one bundle or shelf change: the rule behind it with support, confidence and lift, why lift matters more than the raw count, and how the owner could test it before committing.
The rule
Why this one
How sure we are
How to test it
Rubric
Criterion
Points
Gives the chosen rule's support, confidence and lift.
2
Explains why lift corrects for popular items.
2
Weighs the rule's support against the small number of baskets.
2
Proposes a way to test the recommendation before acting on it.
1
Notes the baskets are illustrative and few.
1
Model answer
Show the model answer
The rule. Coffee and sugar appear together in 6 of the 40 baskets, more than three times as often as their popularity predicts (lift about 3.4), which makes coffee → sugar a good bundle candidate. Quote the support, confidence and lift of the rule you chose from your run.
Why this one. Lift compares how often the items appear together with how often they would if shoppers chose them independently. Bread and milk share 9 baskets, the joint-highest count of any pair, but both are in about half of all baskets, so their lift is about 0.95: no pull at all. Bananas and cereal have the highest lift (about 3.8) but only 4 baskets behind it.
How sure. Forty baskets is a small log, so a rule seen in a few baskets can come and go with the next week's shopping. The thresholds also mean the rules were found by searching many pairs, so some high-lift rules will be chance.
How to test it. Run the bundle offer or the shelf change for a few weeks, alternating with the current layout, and compare how often the pair is bought together. The baskets here are illustrative.