As digital marketing and analytics continue to thrive symbiotically, cross-selling and upselling have become the mantra of the decade. A key component of deriving consumer insights is market basket analysis or MBA. In this article, we give you the upshot of market basket analysis and how it can be utilized to understand the customers better. We also take a look at some real-world Market Basket Analysis examples and how they have impacted a variety of sectors.
The most accurate Market Analysis definition is – a data mining technique that is used to uncover purchase patterns in any retail setting. The goal of Market Basket Analysis is to understand consumer behavior by identifying relationships between the items that people buy. For example, people who buy green tea are also likely to buy honey. So Market Basket Analysis would quantitatively establish that there is a relationship between Green Tea and Honey. The same goes for bread, butter, and jam.
How does market basket analysis work?
Market Basket Analysis is modeled on Association rule mining, i.e., the IF {}, THEN {} construct. For example, IF a customer buys bread, THEN he is likely to buy butter as well.
Association rules are usually represented as: {Bread} -> {Butter}
Some terminologies to familiarise yourself with Market Basket Analysis are:
Now that we have a fair idea of what is Market Basket Analysis and some of the key terms associated with an MBA, let us dig deeper. Market Basket Analysis techniques can be categorized based on how the available data is utilized:
As mentioned before, the market analysis definition is modeled on Association Mining rules. Algorithms that use association mining include AIS, SETM, and Apriori. Among these, the most commonly used algorithm for MBA is the Apriori Algorithm.
The following section explores the Apriori algorithm in detail:
Apriori algorithm works with the assumption that any subset of a frequent itemset must be frequent.
Consider the below dataset:
Transaction ID
Bread
Peanut Butter
Jelly
1
2
0
3
4
5
Every transaction is a combination of 0s and 1s. 0s represent the absence of an item, and 1s represent its presence. Let us calculate the key metrics using the above data points.
Support of bread = freq{bread}/N
= 3/5 = 0.6
Support indicates the relative frequency with which the rule occurs. High support indicated a strong correlation between two items or itemsets. Note that there may be meaning in mining low support as well, in case you’re looking for “hidden” relationships.
2. Confidence of Y: Given two items, X and Y, confidence measures the percentage of times that item Y is purchased, given that item X was purchased.
Confidence {bread -> peanut butter} = Freq(bread, peanut butter)/Freq(bread)
= (2/6) / (3/6) = 0.667
Confidence values always range from 0 to 1. Confidence is a measure of the reliability of the rule. Confidence of .667 in the above example means that in 66.7% of the cases where bread was purchased, the purchase also included peanut butter.
3. Lift: Increase in the sale of X when you sell Y.
Lift{Bread, peanut butter} = Confidence(bread, peanut butter) / Support(peanut butter)
= 0.667 / (3/6) = 1.334
Lift is the ratio of the observed support to that expected support if the two rules were independent. Lift gives powerful insights into Market Basket Analysis and can help you determine how accurate your predictions are.
Here is what the lift-value indicates:
Performing Market Basket Analysis in R
The arules package is an open-source toolkit for association mining using the R programming language.
Here’s an example code for running the Apriori algorithm in R:
# Load the libraries
library(arules)
library(arulesViz)
library(datasets)
# Load the data set
tr <- read.transactions(‘market_basket.csv’, format = ‘basket’, sep=’,’)
View(tr)
# Create an item frequency plot for the top 20 items
itemFrequencyPlot(tr,topN=20,type=”absolute”)
# Get the rules
rules <- apriori(tr, parameter = list(supp=0.001, conf=0.8))
rules <- sort(rules, by=’confidence’, decreasing = TRUE)
summary(rules)
#Inspect top 10
inspect(rules[1:10])
# Plot the top 10 rules
topRules <- rules[1:10]
plot(topRules)
plot(topRules, method=”graph”)
plot(topRules, method = “grouped”)
Market Basket Analysis examples
This section explores Market Basket Analysis examples by market segment:
Perhaps the most well-known MBA case-study is Amazon.com. Any time you view a product on Amazon, the product page automatically recommends, “Items bought together frequently.” It is perhaps the simplest and most clean example of cross-selling techniques using MBA.
Apart from e-commerce formats, BA is also widely applicable to the in-store retail segment. Grocery stores pay meticulous attention to product placement based and shelving optimization. For example, you are almost always likely to find shampoo and conditioner placed very close to each other at the grocery store.
Walmart’s infamous beer and diapers association anecdote is also an example of Market Basket Analysis.
2. Telecom: With the ever-increasing competition in the telecom sector, companies are paying close attention to the services that customers are frequently using. For example, Telecom has now started to bundle TV and Internet packages apart from other discounted online services to reduce churn.
Here’s a study by McKinsey on how the telecom industry can restructure plans efficiently using MBA:
3. IBFS: Tracing credit card history is a hugely advantageous MBA opportunity for IBFS organizations. For example, Citibank frequently employs sales personnel at large malls to lure potential customers with attractive discounts on the go. They also associate with apps like Swiggy and Zomato to show customers a multitude of offers they can avail via purchasing through credit cards.
IBFS organizations also use basket analysis to determine fraudulent claims.
This research paper by Marzieh Vahidi Roodpishi and Reza Aghajan Nashtaei, published in the Management Science letters journal, determines how MBA can be used to better group customers.
4. Medicine: In the medical field, basket analysis is used to determine comorbid conditions and symptom analysis. It can also help identify which genes or traits are hereditary and which are associated with local environmental effects.
DRDO has run a detailed study that associated clinical parameters with the diagnosis of brain tumors.
Despite being a three-decade-old technique, market analysis definition remains a valuable solution for insights in both the brick-and-mortar and eCommerce sectors.
Despite being a relatively simple algorithm, Market Basket Analysis is a quick and easy first step towards uncovering hidden patterns from your customers. However, there are many more such interesting methods to delve into the world of analysis and data mining. Jigsaw Academy’s 10-month online Integrated Program in Business Analytics (IPBA), in partnership with the Indian Institute of Management, Indore, is a great headstart to business analytics. If you find people analytics and consumer behavior more interesting, the People Analytics & Digital HR course may be the right choice for you. From full-fledged PG programs to crunch-based bootcamps, Jigsaw Academy covers everything there is in the analytics world. Click here to explore what’s right for you.
Fill in the details to know more
Important Artificial Intelligence Tools
October 31, 2022
Top 28 Data Analytics Tools For Data Analysts | UNext
September 27, 2022
Stringi Package in R
May 5, 2022
Best Frameworks In Java You Should Know In 2021
May 5, 2021
Lean Management Tools: An Ultimate Overview For 2021
May 4, 2021
Talend ETL: An Interesting Guide In 4 Points
Add your details:
By proceeding, you agree to our privacy policy and also agree to receive information from UNext through WhatsApp & other means of communication.
Upgrade your inbox with our curated newletters once every month. We appreciate your support and will make sure to keep your subscription worthwhile