top of page

Cracking the Code of Shopper Habits: The Secret Science Behind Supermarket Shelves

Photo by Marjan Blan on Unsplash

Have you ever wondered how supermarkets seem to know just the right products to place together to tempt you into buying more? This seemingly intuitive arrangement is often the result of a powerful data analysis technique known as co-occurrence grouping. In this article, we will explore the concept of co-occurrence grouping, delve into its methods, and illustrate its application through supermarket analogies.

What is Co-occurrence Grouping?

Co-occurrence grouping, also known as association rule mining or market basket analysis, is a type of unsupervised learning used to identify patterns and associations between items in large datasets. This technique is widely used in retail to analyze customer transactions and uncover relationships between products that are frequently bought together.

Key Concepts in Co-occurrence Grouping

  1. Support: The frequency with which items appear in transactions.

  2. Confidence: The likelihood that a specific item is purchased when another item is purchased.

  3. Lift: The increase in the probability of an item being purchased when another item is purchased, compared to the item’s general purchase probability.

Methods of Co-occurrence Grouping

Several algorithms can be employed to perform co-occurrence grouping. The most common include:

  1. Apriori Algorithm: A classic algorithm that identifies frequent itemsets and generates association rules.

  2. FP-Growth (Frequent Pattern Growth): An efficient method that uses a tree structure to find frequent itemsets without candidate generation.

  3. Eclat Algorithm: Uses a depth-first search approach to mine frequent itemsets.

Supermarket Analogies and Examples

To understand how co-occurrence grouping works in a supermarket setting, let’s explore three illustrative examples:

Example 1: Commonly Purchased Items

Scenario: A supermarket wants to identify items that are frequently bought together to optimize product placement.

Hypothetical Data:

  • Milk: 70% of transactions

  • Bread: 65% of transactions

  • Milk and Bread Together: 50% of transactions


  • Support for Milk and Bread: 50%

  • Confidence for Milk → Bread: 50% / 70% = 71.4%

  • Confidence for Bread → Milk: 50% / 65% = 76.9%

  • Lift: (50% / (70% * 65%)) = 1.1

Interpretation: Customers who buy milk are very likely to buy bread as well. By placing these items near each other, the supermarket can enhance customer convenience and potentially increase sales.

Example 2: Seasonal Product Bundling

Scenario: During the summer, a supermarket wants to create promotional bundles to boost sales.

Hypothetical Data:

  • Burgers: 30% of summer transactions

  • Charcoal: 25% of summer transactions

  • Burgers and Charcoal Together: 20% of summer transactions


  • Support for Burgers and Charcoal: 20%

  • Confidence for Burgers → Charcoal: 20% / 30% = 66.7%

  • Confidence for Charcoal → Burgers: 20% / 25% = 80%

  • Lift: (20% / (30% * 25%)) = 2.67

Interpretation: There is a high likelihood that customers buying burgers will also buy charcoal, especially during the summer. The supermarket can create a summer grilling bundle that includes burgers, charcoal, buns, and condiments, offering a discount for purchasing the bundle.

Example 3: Cross-Promotions

Scenario: The supermarket wants to increase the sales of less popular items by leveraging popular ones.

Hypothetical Data:

  • Diapers: 40% of transactions

  • Baby Wipes: 35% of transactions

  • Diapers and Baby Wipes Together: 30% of transactions


  • Support for Diapers and Baby Wipes: 30%

  • Confidence for Diapers → Baby Wipes: 30% / 40% = 75%

  • Confidence for Baby Wipes → Diapers: 30% / 35% = 85.7%

  • Lift: (30% / (40% * 35%)) = 2.14

Interpretation: Customers who buy diapers are very likely to also buy baby wipes. The supermarket can place promotional offers on baby wipes for customers purchasing diapers, such as a discount on baby wipes when bought together with diapers, encouraging customers to buy both items.


Co-occurrence grouping is a powerful tool that helps supermarkets and other retailers understand the buying habits of their customers. By leveraging this technique, businesses can optimize product placements, create effective promotional bundles, and increase cross-selling opportunities. Whether through the Apriori algorithm, FP-Growth, or Eclat, the insights gained from co-occurrence grouping can lead to more informed decisions and improved customer satisfaction.

Understanding and applying these principles can significantly enhance a supermarket’s ability to cater to its customers’ needs, ultimately driving sales and fostering customer loyalty. So, the next time you notice a well-placed product pair or an enticing promotional bundle, you’ll know the data-driven strategy behind it.

9 views0 comments


Obtuvo 0 de 5 estrellas.
Aún no hay calificaciones

Agrega una calificación
Featured Posts
Recent Posts
bottom of page