BRdata Analytics: Item Affinities

Grocers operate in a complex retail environment with thousands of SKUs, only some of which might catch a shopper’s attention on any given visit, whether physical or digital. This presents an interesting, and difficult, problem: which items should be located near each other? Beyond simply organizing items by a grocer’s internal Categories–Category 1 Items together and so on–grocers want to know if there are powerful connections between items in different Categories such that placing these items near each other increases shopper satisfaction and the grocer’s bottom line.

Affinity Analysis Report

BRdata offers its Cloud subscribers the Affinity Analysis report to assist grocers in identifying exactly these kinds of relationships. For example, imagine a grocer has noticed that there is some extra space in the cereal aisle of a specific store and they are wondering if they want to place one or maybe two retail displays of complementary items in the aisle. By clicking “Reports” > “Basket Analysis” > “Affinity Analysis” in the upper navigation bar, they would be presented with a screen where the grocer needs to input their desired parameters.

Affinity Analysis Screenshot

Our grocer is going to select 2022 Q2 for a single store and then choose their target items. By clicking on “Select UPC” in the “UPC” subsection, the grocer now has various ways to select their target SKU(s). In this case, we’ll click on the “UPC Query” tab in order to “Select UPCs where: Category = Cereal” simply by starting to type the word “cereal” in the “Description” search bar.

Affinity Analysis Category Screenshot

Now, clicking on the bottom row and then clicking “Confirm” selects the “Cereal” category of interest. While they could continue to select further categories of interest, for now they simply click “Search” to find SKUs in that Category, tick the “Select All” box, then the blue “Select Item(s)” button to select the items of interest. Skipping the addition of other target items, our grocer clicks the “Confirm” button to finalize the target SKUs for this report.

The last parameters may be the most unfamiliar to readers. These are the “Minimum %” and “Minimum Affinity Gain %” in the “Affinity Threshold” section. To make things simpler, let’s start by defining “target baskets” as all baskets in which you find one or more of your target items. Briefly, if you set “Minimum %” at 8, the only SKUs returned by the report will be those found in \(\geq\) 8% of “target baskets.” If you set “Minimum Affinity Gain %” at 3, the only SKUs returned by the report will be those whose presence in “target baskets” is \(\geq\) 3 percentage points greater than their presence in “all baskets.” For example, if a specific SKU is found in 8% of “all baskets” in 2022 Q2, that SKU needs to be found in \(\geq\) 11% of “target baskets” in the same quarter to be included in the report. Note that if the results set is too large or too small, our grocer can always click “New Report” at the top right in order to load the last report’s parameters and then tweak the ones they would like to change, for example, raising the “Minimum %” to 12.

Affinity Analysis Results Screenshot

While there are some uninteresting items in the results set, we did learn that bananas, tomatoes, broccoli, and avocados all met our thresholds. Our grocer can now decide whether any of these items is worth trying as a retail display in their cereal aisle.

Association Rules

One solution that BRdata’s Data Science team is playing around with, imagining it brings new value to our customers, is letting this grocer ask a slightly different question: which are the most powerful relationships between items, not merely using the cereal Category as our target, but in the whole store? We’re also going to add in a few other twists.

  • We are going to focus on SKUs in the Grocery Department, excluding Produce, Dairy, Frozen, etc.
  • Groups of items are allowed, for example, bananas, strawberries, plus both bananas and strawberries at the same time.

In 2022 Q2, there were about 30,000 baskets in this store that included Items from the Grocery Department. Let’s restrict our search to items that appear in at least 1 out of every 2,000 baskets. Let’s also require that if, for example, a cereal SKU is in a basket, the complementary SKU is also in the basket in at least 1 out of every 100 baskets. Having narrowed our search, now we take a look at the top 10 most powerful relationships in this store.

The way that we will define “most powerful relationship” is Lift. To say that bananas are lifted by apples is to say that it is more probable to observe bananas in a basket if there are also apples in the basket than it is to observe bananas in a random basket.

Top 10 Association Rules by SKU
A1BBaskets_ABaskets_BLift
1V8 LOW SODIUMKIND GF BFST BR HNY OAT4331580
2KIND GF BFST BR HNY OATV8 LOW SODIUM3143580
3V8 LOW SODIUMNV GRNL BAR OAT HONEY4338380
4NV GRNL BAR OAT HONEYV8 LOW SODIUM3843380
5GLC VTM WTR ZERO XXXGLC VTMN WTR ZERO POWER C6256260
6GLC VTMN WTR ZERO POWER CGLC VTMN WTR ZERO XXX 5662260
7DD MOCHA ICED COFFEEDD ICED COFFEE7177220
8DD ICED COFFEEDD MOCHA ICED COFFEE7771220
9GLC VTMN WTR ZERO SQUEEZEDGLC VTMN WTR ZERO XXX5862190
10GLC VTMN WTR ZERO XXXGLC VTM WTR ZERO SQUEEZED6258190

Although some of these relationships may not be strikingly unexpected, the grocer could simply remove the Drinks Category or otherwise tweak the universe of Items to eliminate relationships that are not of concern. But hold on, look at what our grocer has now learned. First, not only is V8 Low Sodium associated with cereal bars in 2022 Q2, but it is the strongest relationship among SKUs in the store. Moreover, it is 300 to 600 times more likely to see these SKUs together than apart–stockouts of one may significantly harm sales of the other. I would bet that very few readers expected a vegetable juice to cereal bar connection, and certainly not at this level of Lift. Lastly, although there are 10 rows, there are actually 5 pairs–where each row is flipped around in a different row. This means that it is not that when one adds V8 to the basket, one then adds a cereal bar (and not the other way around), but that one adds them together as a pair. This strongly suggests as well that these are complementary goods–a price decrease in either one increases sales of the other.

Now, to keep going, let’s imagine that the grocer reviewed the top 50 relationships and thought to themselves, “this is more fine-grained than I wanted.” Perhaps our grocer really intended to discover new relationships between Categories rather than between SKUs. Well, we can do that.

Top 10 Association Rules by Category
A1A2BBaskets_ABaskets_BLift
1FRUIT-PBJ-PANCAKE-HONEY-PROTNJUICE-TEA-GATORADE-WATERCEREAL-POPTARTS-GRANOLA-OATML54025854
2COOKIES & CRACKERSJUICE-TEA-GATORADE-WATERCEREAL-POPTARTS-GRANOLA-OATML81125854
3COOKIES & CRACKERSPASTA-TOMATO-ETHNICCEREAL-POPTARTS-GRANOLA-OATML81425853
4CEREAL-POPTARTS-GRANOLA-OATMLDSD BREADFRUIT-PBJ-PANCAKE-HONEY-PROTN69926353
5COOKIES & CRACKERSDSD BREADCEREAL-POPTARTS-GRANOLA-OATML89125853
6SPECIALTYJUICE-TEA-GATORADE-WATERCEREAL-POPTARTS-GRANOLA-OATML90625853
7FRUIT-PBJ-PANCAKE-HONEY-PROTNPASTA-TOMATO-ETHNICVEG-BEAN-RICE-STUFFING-MEAT639 33743
8FRUIT-PBJ-PANCAKE-HONEY-PROTNDSD BREADCEREAL-POPTARTS-GRANOLA-OATML76225853
9CEREAL-POPTARTS-GRANOLA-OATMLJUICE-TEA-GATORADE-WATERFRUIT-PBJ-PANCAKE-HONEY-PROTN71626353
10COOKIES & CRACKERS SPECIALTYCEREAL-POPTARTS-GRANOLA-OATML7592585 3

Note that in the case of Categories, there are sometimes multiple Categories (A1 and A2) that lift another Category.

Now, one way we might adjust our results is to recognize that, depending on the number of baskets in which we find A and B, Lift is constrained to fall within a certain range. If we instead rank relationships based on how strong they are relative to how strong they could be, we see different results.

Top 10 Association Rules by Category, Standardized Lift
A1A2BBaskets_ABaskets_BLift
1VEG-BEAN-RICE-STUFFING-MEATDRESSING-CONDIMENTS-OIL-VNGRPASTA-TOMATO-ETHNIC85265812
2COOKIES & CRACKERSDSD BREADSALTY SNACKS89187712
3COOKIES & CRACKERSPASTA-TOMATO-ETHNICSALTY SNACKS81487712
4JUICE-TEA-GATORADE-WATERDSD BREADSALTY SNACKS124087712
5COOKIES & CRACKERSDRESSING-CONDIMENTS-OIL-VNGRSALTY SNACKS82187712
6COOKIES & CRACKERSJUICE-TEA-GATORADE-WATERSALTY SNACKS81187712
7IGADRESSING-CONDIMENTS-OIL-VNGRPASTA-TOMATO-ETHNIC82865812
8PASTA-TOMATO-ETHNICDSD BREADSALTY SNACKS133087711
9PASTA-TOMATO-ETHNICDSD BREADDRESSING-CONDIMENTS-OIL-VNGR133063642
10PASTA-TOMATO-ETHNIC JUICE-TEA-GATORADE-WATERSALTY SNACKS98787712

Here I think we not only have the strongest inter-Category relationships in the whole store during 2022 Q2, but at least three other consequences.

  • First, these relationships may suggest novel in-store arrangements to our grocer.
  • Second, these relationships might motivate our grocer to spend more time disaggregating Categories according to shoppers’ habits–maybe “VEG-BEAN-RICE-STUFFING-MEAT” is too broad and obscures more useful relationships?
  • Third, and something we might cover in a future post, whether finding relationships between SKUs or Categories, marketing may comb through these relationships in order to discover new strategies to satisfy shoppers’ demands with personalized outreach.

See you next time and don’t hesitate to let us know what you think!

Click here to add your own text

Click here to add your own text