Market basket analysis is a technique that discovers relationships between pairs of products purchased together. The technique can be used to uncover interesting cross-sells and related products. In this post I’ll show you how simple market basket analysis can be and how to use the data in the ATG data warehouse to do your own market basket analysis.
The idea behind market basket analysis is simple. Simply examine your orders for products have been purchased together. For example using market basket analysis you might uncover the fact that customers tend to buy hot dogs and buns together. Using this information you might organize the store so that hot dogs and buns are next to each other. In an e-commerce environment you might create a cross-sell rule to offer the shopper buns whenever they place hot dogs in their shopping cart.
There are a couple of measures we use when doing market basket analysis and they are described here. The first measure is the frequency. The frequency is defined as the number of times two products were purchased together. If hot dogs and buns were found together in 820 baskets this would be its frequency.
Frequency by itself doesn’t tell the whole story. For instance if I told you hot dogs and buns were purchased 820 times together you wouldn’t know if that was relevant or not. Therefore we introduce two other measures called support and confidence to help with the analysis.
If you divide the frequency by the total number of orders you get the percentage of order containing the pair. This is called the support. Another way to thinking about support is as the probability of the pair being purchased. Now if 820 hot dogs and buns were purchased together and your store took 1000 orders the support for this would be calculated as (820 / 1000) = 82.0% .
We can extend this even further by defining a calculation called confidence. Confidence compares the number of times the pair was purchased to the number of times one of the items in the pair was purchased. In probability terms this is referred to as the conditional probability of the pair. So going back to our hot dogs example if hot dogs were purchases 900 times and out of those 900 purchases 820 contained buns we would have a confidence of (820 / 900) = 91.1%.
Now that we’ve defined frequency, support and confidence we can talk a little about what a market basket analysis report might look like. The report would have the user select the product they are interested in performing the analysis on (ie hot dogs). Then it would list all the products that were purchased together with the selected products ranked by it frequency. It might look something like the following
Market Basket Analysis: Hot Dogs
| Product |
Frequency |
Support |
Confidence |
|
| Buns |
820 |
82.0% |
91.1% |
| Ketchup |
800 |
80.0% |
23.2% |
| Mustard |
750 |
75.0% |
34.5% |
| Jello |
321 |
32.1% |
45.2% |
As a merchandiser I tend to look for pairs with a high confidence. A confidence of 100% means that the products are always purchased together. The higher the confidence means that there is probably a strong relationship between the products. When looking at reports like this you’ll find that some of the obvious pairs have the highest confidence (like hot dogs and buns!) but as you keep looking down the list you should discover some of the more interesting pairings you might not have thought of.
After examining the confidence I next look at the support. A low support means that the pair isn’t purchased a lot. This doesn’t mean it would make a bad cross sell just that they aren’t ordered together very frequently. Use your own judgment. Obviously if you see something with both a high confidence and high support you’ve found something interesting.
You can create a report to perform market basket analysis with ATG Customer Intelligence. See the attached xml for the report definition. To install this report just copy the report definition xml to your clipboard. Next start Report Studio with a blank report. Finally use the Tools->Open Report from Clipboard option and save the report to your environment.
download sample report : market-basket-analysis