HOME  >>  Single Blog

Market Basket Analysis: The Key to Effective Retail Strategy

Data AnalysisData Analysis Model

Published: April 05, 2023    |     null MIN READ

Share

blog-banner

The following article will briefly introduce what Market Basket Analysis is and how to use the self-service big data analysis tool FineBI to perform Market Basket Analysis without writing code.

Table Of Contents

Market Basket Analysis is a commonly used data analysis technique in product analysis, and the classic case of "Selling Beer and Diapers Together" is an example of Market Basket Analysis.

In supermarkets, baby diapers and beer are often sold together because data analysis has shown that fathers are the main purchasers of diapers, and they are likely to buy beer when they see it while shopping for diapers. This increases the sales of beer. While most people may have heard of this case, many may not know the algorithm and essence behind it.

Market Basket Analysis

 

In fact, this analysis method, which studies consumer consumption data, associates different products and mines the connection between them, is called product association analysis, also known as “Market Basket Analysis.”

Market Basket Analysis is widely used in e-commerce and retail analysis, but many people only do superficial purchase rate correlation analysis, and true product association analysis is not so simple. Furthermore, most Market Basket Analysis tutorials found online require the use of R or Python language. How can we perform data analysis without writing code?

The following article will briefly introduce what Market Basket Analysis is and how to use the self-service big data analysis tool FineBI to perform Market Basket Analysis without writing code.

What is Market Basket Analysis?

Market basket analysis is a popular data mining technique utilized by retailers to gain insights into customer purchasing patterns and increase sales. By analyzing large datasets, such as purchase history, market basket analysis can reveal product groupings and identify items that are often purchased together.

The adoption of market basket analysis has been greatly facilitated by the advent of electronic point-of-sale (POS) systems and e-commerce. Compared to handwritten records previously kept by store owners, the digital records generated by POS systems make it easier for applications to process and analyze large volumes of purchase data.

Implementing market basket analysis requires a solid foundation in statistics and data science, as well as algorithmic computer programming skills. However, for those lacking the necessary technical skills, there are pre-existing commercial BI software solutions available. Such as FineBI, a self-service data analysis tool centered on business reports to help you quickly gain useful insights through data.

Purpose of Market Basket Analysis

Market Basket Analysis, also known as product association analysis, is a data analysis method commonly used in product analysis. The term "association" refers to the interdependence between one thing and another.

In Market Basket Analysis, it is defined as mining a certain set of rules through a customer's purchase record database, ultimately discovering the underlying commonalities in their purchasing habits.

Market Basket Analysis

 

So, what does "underlying commonalities" mean?

To give a simple example, women typically buy cosmetics, clothing, and daily necessities in a supermarket, while men usually buy achohol and sports magazines. Therefore, supermarkets will set up women's counters and men's counters to achieve product classification through simple customer segmentation.

We all know that the purpose of data analysis is to find correlations and connections between data. For products, what is the purpose of product analysis?

The answer is to identify customer purchasing behavior patterns.

For example, does the purchase of product A by a customer have any impact on product B? Does a customer's purchasing behavior today affect sales tomorrow? Do different customers have different purchasing patterns, and so on.

This type of mining requires certain rules, which are the algorithms used in Market Basket Analysis, and this is what we will discuss below.

Key Indicators of Market Basket Analysis

There are many indicator systems in Market Basket Analysis. Generally, the following three are more common:

1.Support 

Support is a measurement of the importance of association rules. Support refers to the probability that items A and B are purchased together or the proportion of purchases of a certain combination of items to the total number of purchases. It is represented by the intersection between the two.

Support of Market Basket Analysis

The formula for support is: S = F[(A&B)/N]

Where S represents support, F represents the probability function, A&B represents the number of times A and B are purchased together, and N represents the total number of purchases.

For example, if there are 10 orders today and milk and bread are purchased together 6 times, then the confidence level for milk and bread combination is 60%.

2.Confidence

Confidence is a measure of the accuracy of association rules. Confidence refers to the conditional probability of purchasing item B after purchasing item A. In other words, it is the probability of purchasing B because A has been purchased. It is represented by the proportion of intersection in A.

The formula for confidence is: C = F(A&B)/F(A)

Where C represents confidence, F represents the conditional probability, A&B represents the number of times A and B are purchased together, and A represents the number of times A is purchased.

For example, if there are 10 orders today and item A is purchased eight times, and item A and B are purchased together six times, then the confidence level is 75%.

3.Lift

Lift is the measure of the effect of purchasing item A on purchasing item B. It is used to determine whether the combination of items has practical value. In other words, it is used to see if the combination of items is purchased more frequently than the individual items. If the value is greater than 1, it means that the combination is effective, while if it is less than 1, it means that it is ineffective.

The formula for lift is: L = S(A&B)/[S(A)*S(B)]

Where L represents lift, S(A&B) represents the support of A and B being purchased together, and S(A)*S(B) represents the product of the probabilities of purchasing item A and item B.

For example, if there are 10 orders today and item A is purchased eight times, item B is purchased four times, and A and B are purchased together six times, then the lift is 0.6/(0.8*0.4)>1. Therefore, the combination of item A and item B is effective.

An Market Basket Analysis Example Without Coding

Most of the tutorials on Market Basket Analysis found on the internet require the use of the R or Python language. How can you perform data analysis without writing any code?

In this article, we will demonstrate how to perform Market Basket Analysis using the self-service big data analysis tool FineBI.

 

FineBI is a concise and easy-to-use data analysis tool that offers the advantages of zero-code visualization and a wide range of visualization charts.

support 50+ types of charts_ (1).png

You can achieve stunning visualizations by simply dragging and dropping data, and it provides features such as data integration, visual data processing, exploratory analysis, data mining, and visualization reporting. Additionally, the personal version of FineBI is free.

GIF 2023-3-2 17-07-46.gif

FineBI enables self-service data analysis with a low learning curve, requiring little to no programming knowledge. Compared to many foreign tools, it is more user-friendly and suitable for business and operational personnel. In terms of comprehensiveness, FineBI stands out and is easy to use without programming. It can achieve platform display and is more suitable for corporate and individual users.

Using FineBI, you can easily build various classic data analysis models, such as the AARRR Model, ABC Analysis, BCG Matrix Analysis, to help businesses gain insights.

image (41).png

FineBI offers different industry-specific business topic analysis scenarios, such as manufacturing, pharmaceuticals, retail, and finance. Through business indicator data analysis and presentation, relevant management personnel can easily grasp business trends.

Loan_Default_Risk_Analysis_page-0001 (1).jpg

FineBI liberates business personnel from data processing and visualization, allowing them to focus more on data analysis, management, and business communication.

 

Next, we will use FineBI to conduct Market Basket Analysis:

4123341055.png
2049708856.png

1. Calculate "total purchase orders"

1) Create a self-service dataset using the "Group Product Sales Summary Table", name it as "total purchase order dataset", and check the "document code", as shown in the figure below:

1100269162.png

 

2542976826.png

 

2) Add a group summary, drag the "document code" into the "Group" and "Summary" columns respectively, and set the summary column's summary mode to "Distinct Coount", as shown in the figure below:

2193339689.png

 

3) Add a new column, name it "total purchase orders", sum up the number of document codes, and click "OK", as shown in the figure below:

63682911.png

 

4) Save and update the self-service dataset.

2. Calculate the number of orders for a single product

1) Create a new self-service dataset using the "Group Product Sales Summary Table" and name it: "single product order number table", check the "product name" and "document code" fields, as shown in the figure below:

2326715064.png

 

2) Add a group summary, drag the "product name" and "document code" into the grouping column summary column respectively, and set the summary column summary mode to "Distinct Count", as shown in the figure below:

3846949221.png

 

3) Save and update the self-service dataset.

3. Calculate "the number of purchases of product1 and product2 orders"

3.1 Use left and right merge to find product combination

At this time, you need to copy a column of the same product category, and merge the two columns together to separate product combinations such as A+A, A+B, B+A, etc.

1) Use "Group Product Sales Summary Table" to create a new self-service dataset:

shopping basket analysis table. Check "document code" and "product name", as shown in the figure below:

1981236934.png

 

2) Add "Left and right merge", the merged dataset is "document code" and "product name" under "Group Product Sales Summary Table":

2339018338.png

 

3) Select "Union combined", and the basis of the combination is "document code":

2658884687.png

 

4) Use "product name" as "product1", and "product name1" as "product2". Add field settings to change the name.

1467986057.png

 

3.2 Filter out unwanted product combinations

Obviously, there is no need for a combination like A+A, so the data needs to be filtered out.

Add a"Filter", click "Add Formula", enter the function: product1!=product2, click "OK", as shown in the figure below:

2540528141.png

 

3.3 Remove duplicate data

As in one order, the same product may be purchased multiple times. We do not need to calculate duplicate data, so add grouping and summary, as shown in the following figure.

Thus there is no duplicate value for such a product combination.

2549407444.png

 

3.4 Count the number of purchases of product1 and product2 orders

1) Add an auxiliary column, which is a constant column with a value of 1, as shown in the following figure:

929615929.png

 

2) Count the number of orders for purchasing product1 and product2 at the same time, and calculate the number of 1s in the same category of goods as the number of times each product combination is purchased, as shown in the following figure:

2280108451.png

4. Find "Number of purchases product1" “Number of purchases product2”

1) Add "Left and right merge", and select the "single product order number table" that we created before, as shown in the following figure.

Select "product1" and "product name" as the merge basis, and name the merged result as "product1".

3722105600.png

 

2) In the same way, merge it with the "single product order number table" once again, select "product2" and "product name" as the merge basis, and name the merged result as "product2".

1912594932.png

 

3) Perform a field setting, and name the "single product order number table-document code" and "single product order number table-document code1" as "Number of purchases product1" and "Number of purchases product2" respectively.

1754195247.png

5. Find “total purchase orders”

Combine the field of "Total Purchase Orders" into this wide table for easy calculation later.

1) Add "Left and right merge", and left merge with the previously created "total purchase order dataset".

2741256619.png

 

2) Select "document code" as the merge basis:

3766831453.png

 

In this way, all the basic indicators "product combination purchase number", "Number of purchases product1", "Number of purchases product2", and "total purchase orders" are all in this wide table. Next, you only need to calculate the support, confidence, and lift.

6. Calculate “support”

Support = product combination purchase number/total purchase orders, and add a new column.

1763808384.png

7. Calculate “confidence”

Confidence level = product combination purchase number/Number of purchases product1, and add a new column.

23026316.png

8. Calculate “lift”

1) Lift = support/((Number of purchases product1/total purchase orders)*(Number of purchases product2/total purchase orders)), and add a new column, as shown below:

3467619720.png

 

2) Save and update the self-service dataset.

9. Create a dashboard

1) Use the "shopping basket analysis table" you just saved to create a dashboard.

Select "Custom Chart" and drag "product1" and "product2" into the horizontal and vertical axes respectively. Select the "rectanglar block" in the "Graphics Properties", and drag the "support" into the "color" bar. Since the mapping will cause the value of multiple orders to be added, the support summary mode needs to be "Average":

2703684003.png

 

2) Create a new component to display the detailed data of "support", "confidence level", and "lift", as shown in the figure below.

Among them, "support, confidence level , lift" will be combined and summed for multiple orders, so their summary mode should be changed to "Average". The value format is set to percentage, as shown in the figure below:

3727626252.png

10. Effect display

And finally, the table and creative chart of Market Basket Analysis has been created! And now you can decide which products are most suitable to be sold together.

4123341055.png
2049708856.png

Final Thoughts

In conclusion, market basket analysis is a crucial tool for businesses to gain insights into customer behavior and improve sales strategies. FineBI offers a user-friendly and code-free solution for conducting this analysis and many other data models, making it an excellent choice for business professionals looking to streamline their data analysis process.

Download FineBI today and see for yourself how it can help you with your data analysis needs.

 

Related Article

who read this article also viewed

post-img

2023-08-11 By  FineBI

What is Exploratory Data Analysis(EDA)?

In this article, we explain what Exploratory Data Analysis is, introduce the three types of EDA and how to do it! Let's learn this complete guide together!


post-img

2024-01-09 By  FineBI

Data Analysis Skills That You Need to Master in 2024

Keeping a finger on the pulse of data analysis skills is crucial. In this article, we will explore the definition of a data analyst, provide ten essential skills for data analysis, and offer some tips. Finally, we will guide you on how to enhance your resume.


post-img

2023-07-26 By  FineBI

Retention Analysis: What is it and How to do it?

Retention analysis involves in-depth research into user behavior and key touchpoints, utilizing business intelligence analytics tools to gain a comprehensive understanding of how to retain existing customers and improve user engagement. This article aims to elucidate its significance, methodologies, and demonstrate how FineBI can be used for a retention analysis example.


Start a new journey of business intelligence and big data analysis with FineBI

Try it now and get over 100 data analysis templates for business scenarios in various industries.

Try FineBI for Free