0% found this document useful (0 votes)
18 views8 pages

Unit 4

Unit 4

Uploaded by

rulercosta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views8 pages

Unit 4

Unit 4

Uploaded by

rulercosta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

What Is Market Basket Analysis?

Market basket analysis is a strategic data mining technique used by


retailers to enhance sales by gaining a deeper understanding of
customer purchasing patterns. This method entails the examination
of substantial datasets, such as historical purchase records, in order
to unveil inherent product groupings and identify items that tend to
be bought together.

By recognizing these patterns of co-occurrence, retailers can make


informed decisions to optimize inventory management, devise
effective marketing strategies, employ cross-selling tactics, and
even refine store layout for improved customer engagement.

For example, if customers are buying milk, how probably are they to
also buy bread (and which kind of bread) on the same trip to the
supermarket? This information may lead to an increase in sales by
helping retailers to do selective marketing based on predictions,
cross-selling, and planning their ledge space for optimal product
placement.

Now, just think of the universe as the set of items available at the
store, then each item has a Boolean variable that represents the
presence or absence of that item. Now each basket can then be
represented by a Boolean vector of values that are assigned to
these variables. The Boolean vectors can be analyzed for purchase
patterns that reflect items that are frequently associated or bought
together. Such patterns will be represented in the form of
association rules.

How Does Market Basket Analysis Work?

1. Collect data on customer transactions, such as the items


purchased in each transaction, the time and date of the
transaction, and any other relevant information.
2. Clean and preprocess the data, removing any irrelevant
information, handling missing values, and converting the data
into a suitable format for analysis.
3. Use association rules mining algorithms such as Apriori or FP-
Growth to identify frequent item sets, sets of items often
appearing together in a transaction.
4. Calculate the support and confidence for each frequent
itemset, which expresses the likelihood of one item being
purchased given the purchase of another item.
5. Generate association rules based on the frequent itemsets
and their corresponding support and confidence values.
Association rules express the likelihood of one item being
purchased given the purchase of another item.
6. Interpret the results of the market basket analysis, identifying
which items are frequently purchased together, the strength
of the association between items, and any other relevant
insights into customer behavior and preferences.
7. Use the insights from the market basket analysis to inform
business decisions such as product recommendations, store
layout optimization, and targeted marketing campaigns.

Types of Market Basket Analysis

1. Predictive Market Basket Analysis employs supervised


learning to forecast future customer behavior. By recognizing
cross-selling opportunities through purchase patterns, it
enables applications like tailored product recommendations,
personalized promotions, and effective demand forecasting.
Additionally, it proves valuable in fraud detection.
2. Differential Market Basket Analysis compares purchase
histories across diverse segments, unveiling trends and
pinpointing buying habits unique to specific customer groups.
Its applications extend to competitor analysis, identification of
seasonal trends, customer segmentation, and insights into
regional market dynamics.

Applications of Market Basket Analysis


Industry Applications of Market Basket Analysis
Retail Identify frequently purchased product
combinations and create promotions or cross-
selling strategies
E-commerce Suggest complementary products to customers
and improve the customer experience
Hospitality Identify which menu items are often ordered
together and create meal packages or menu
recommendations
Healthcare Understand which medications are often
prescribed together and identify patterns in
patient behavior or treatment outcomes
Banking/Finance Identify which products or services are
frequently used together by customers and
create targeted marketing campaigns or bundle
deals
Telecommunication Understand which products or services are often
s purchased together and create bundled service
packages that increase revenue and improve
the customer experience

What Is Association Rule for Market Basket Analysis?

Let I = {I1, I2,…, Im} be an itemset. These itemsets are called


antecedents. Let D, the data, be a set of database transactions
where each transaction T is a nonempty itemset such that T ⊆ I.
Each transaction is associated with an identifier called a TID(or Tid).
Let A be a set of items(itemset). T is the Transaction that is said to
contain A if A ⊆ T. An Association Rule is an implication of form A
⇒ B, where A ⊂ I, B ⊂ I, and A ∩B = φ.
The rule A ⇒ B holds in the data set(transactions) D with supports,
where ‘s’ is the percentage of transactions in D that contain A ∪
B (i.e., the union of set A and set B, or both A and B). This is taken
as the probability, P(A ∪ B). Rule A ⇒ B has confidence c in the
transaction set D, where c is the percentage of transactions in D
containing A that also contains B. This is taken to be the conditional
probability, like P(B|A). That is,

 support(A⇒ B) =P(A ∪ B)
 confidence(A⇒ B) =P(B|A)

Rules that satisfy both a minimum support threshold (called min


sup) and a minimum confidence threshold (called min conf ) are
called “Strong”.

 Confidence(A⇒ B) = P(B|A) =
 support(A ∪ B) /support(A) =
 support count(A ∪ B) / support count(A)

Generally, Association Rule Mining can be viewed in a two-step


process:

1. Find all Frequent itemsets: By definition, each of these


itemsets will occur at least as
frequently as a pre-established minimum support count, min
sup.
2. Generate Association Rules from the Frequent itemsets: By
definition, these
rules must satisfy minimum support and minimum confidence.

Association Rule Mining

Association Rule Mining is primarily used when you want to identify


an association between different items in a set and then find
frequent patterns in a transactional database or relational database.

The best example of the association is as you can see in the


following image.
Algorithms Used in Market Basket Analysis

There are multiple data mining techniques and algorithms used in


Market Basket Analysis. One of the important objectives is “to
predict the probability of items that are being bought together by
customers.”

 Apriori Algorithm
 AIS
 SETM Algorithm
 FP Growth

1. Apriori Algorithm

Apriori Algorithm is a widely-used and well-known Association Rule


algorithm and is a popular algorithm used in market basket analysis.
It is also considered accurate and overtop AIS and SETM algorithms.
It helps to find frequent itemsets in transactions and identifies
association rules between these items. The limitation of the Apriori
Algorithm is frequent itemset generation. It needs to scan the
database many times, leading to increased time and reduced
performance as a computationally costly step because of a large
dataset. It uses the concepts of Confidence and Support.
2. AIS Algorithm

The AIS algorithm creates multiple passes on the entire database or


transactional data. During every pass, it scans all transactions. As
you can see, in the first pass, it counts the support of separate items
and determines then which of them are frequent in the database.
Huge itemsets of every pass are enlarged to generate candidate
itemsets. After each scanning of a transaction, the common
itemsets between the itemsets of the previous pass and the items of
this transaction are determined. This algorithm was the first
published algorithm which is developed to generate all large
itemsets in a transactional database. It focused on the enhancement
of databases with the necessary performance to process decision
support. This technique is bounded to only one item in the
consequent.

 Advantage: The AIS algorithm was used to find whether there was
an association between items or not.
 Disadvantage: The main disadvantage of the AIS algorithm is that
it generates too many candidates set that turn out to be small. As
well as the data structure is to be maintained.

3. SETM Algorithm

This Algorithm is quite similar to the AIS algorithm.


The SETM algorithm creates collective passes over the database. As
you can see, in the first pass, it counts the support of single items
and then determines which of them are frequent in the database.
Then, it also generates the candidate itemsets by enlarging large
itemsets of the previous pass. In addition to this, the SETM
algorithm recalls the TIDs(transaction ids) of the generating
transactions with the candidate itemsets.

 Advantage: While generating candidate itemsets, the SETM


algorithm arranges candidate itemsets together with the
TID(transaction Id) in a sequential manner.
 Disadvantage: For every item set, there is an association with Tid;
hence it requires more space to store a huge number of TIDs.

4. FP Growth

FP Growth is known as Frequent Pattern Growth Algorithm. FP


growth algorithm is a concept of representing the data in the form
of an FP tree or Frequent Pattern. Hence FP Growth is a method
of Mining Frequent Itemsets. This algorithm is an advancement to
the Apriori Algorithm. There is no need for candidate generation
to generate a frequent pattern. This frequent pattern tree structure
maintains the association between the itemsets.

A Frequent Pattern Tree is a tree structure that is made with the


earlier itemsets of the data. The main purpose of the FP tree is to
mine the most frequent patterns. Every node of the FP tree
represents an item of that itemset. The root node represents the
null value, whereas the lower nodes represent the itemsets of the
data. The association of these nodes with the lower nodes, that is,
between itemsets, is maintained while creating the tree.

For Example:

Source: i.imgur

Advantages of Market Basket Analysis

There are many advantages to implementing Market Basket


Analysis in marketing. Market Basket Analysis (MBA) can be applied
to data of customers from the point of sale (PoS) systems.

It helps retailers in the following ways:

 Increases customer engagement


 Boosts sales and increases RoI
 Improves customer experience
 Optimizes marketing strategies and campaigns
 Helps in demographic data analysis
 Identifies customer behavior and pattern

Market Basket Analysis From the Customers’ Perspective

Let us take an example of market basket analysis from Amazon, the


world’s largest eCommerce platform. From a customer’s
perspective, Market Basket Analysis is like shopping at a
supermarket. Generally, it observes all items bought by customers
together in a single purchase. Then it shows the most related
products together that customers will tend to buy in one purchase.

You might also like