Market Basket Analysis

9 04 2008

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

Advertisements

Actions

Information

10 responses

24 10 2008
Ajay

Thanks for the detailed explanation 🙂

Do you have any clue on interpreting the results using SAS ?

14 11 2008
K

um…just wondering how the Confidence of Ketchup+Hotdog = 23.2%?
and not equal to 800/900 = 88.9%
did i wrongly interpret it?
thanks

20 11 2008
drakcira

The sample report shown above doesn’t include data about how many times Ketchup and Hotdogs were purchased together. The Frequency , 800, shown above represents the number of times Ketchup was purchased. I didn’t supply how many time Ketchup was purchased with Hotdogs.

You can work backwards to tell the frequency of Hot Dog and Ketchup were purchased together. Knowing that 800 Ketchups were purchased we know from the confidence that 23.2% of those purchases included Hot Dogs. Thus 23.2% of 800 is 186 which represents the frequency both Hot Dogs and Ketchup were purchased together.

Pretty low if you tell me since I like my Hot Dogs with Ketchup!

2 01 2009
5 Things to do with your ATG Data Warehouse « Meta Theory

[…] posted about this before so I won’t go into too much detail about it here. Market basket analysis […]

23 02 2009
Kumar Hemant

Informative and helpful at firts hand.

9 03 2009
Nawarerk

Who invent the term “Market Basket analysis” ?

26 03 2009
ADS

I think either the Explanation given above is not proper, or the sample report shown above is not proper. More specifically the sample report is not proper.

Reason:
Explantion given for the frequency is clear and correct.
Then the Explanation given for Support and confidence is also proper.
But if you calculate the suport and confidence for the sample above then its not matching.
Only for Hotdogs+Buns is correct that is 91.1% But for all others it is wrong.

Let me know if you have any other explanation for this.

Thanks
ADS

30 12 2011
Anonymous

ookjk85h74

18 11 2013
Anonymous

thank

27 02 2014
seo optimization free

I’m really impressed with your writing skills as well as with the
layout on your blog. Is this a paid theme or
did you customize it yourself? Either way keep up the nice quality writing, it is rare to see a great blog like this one nowadays.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: