Market Basket Analysis
About Market Basket Analysis
Market Basket Analysis is used by retailers to analyze the buying pattern. A co-occurrence is when two or more items bought together by customers. It allows the supermarkets to identify relationships between the products that are bought by customers. It is widely used in the Retail and Telecom industry to understand. Here we will see the Market Basket Analysis with Python using Apriori algorithm.
Market Basket Analysis takes data at transaction level, which lists all items bought by a customer in a single purchase. The technique determines relationships of what products were purchased with which other product(s). The rule is If {A} Then {B} The If part of the rule i.e.{A} is known as the antecedent and the Then part of the rule is known as the consequent i.e. {B}. The antecedent is the condition and the consequent is the result.
Retailers can use Market Basket Analysis for -
1. Change store layout
2. Target Marketing by sending promotional messages
3. Trending items in shop
About Apriori Algorithm
Apriori algorithm uses frequent itemsets to generate rules. Apriori algorithm is designed to work on the database containing list of transactions. Apriori property states that, All subsets of a frequent itemset must be frequent. For example: if {AB} is a frequent itemset then both {A} and {B} should be a frequent itemset.
Parameters we consider to know the buying pattern of customers are
1. Support - It is a ratio of how frequently collections of items purchased together to the all transactions. In many instances, you may want to look for high support in order to make sure it is a useful relationship. However, there may be instances where low support is useful if you are trying to find “hidden” relationships.
2. Confidence - Confidence is a measure of reliability of the rule. It is the ratio of the number of transactions that include all {B} items as well as the number of transaction that include all {A} items to the number of transactions that include all {A} items. In a medical situation, 50% confidence level may not be high enough.
3. Lift – Lift is the ratio of the observed support to that expected if the two rules were independent. The basic rule is that a lift value of less than 1 means the rules were completely independent if lift values greater than 1 are generally more “interesting” and could be indicative of useful rule pattern. Greater lift values indicate stronger associations.
4. Leverage – Both lift and leverage measure the relation between the probability of a given rule to occur and its expected probability if the items were independent of each other. The only difference is that lift computes the ratio of both factors and leverage computes the difference.
5. Conviction - Conviction can be interpreted as the ratio of the expected frequency that A occurs without B if A and B were independent divided by the observed frequency of incorrect predictions. This is monotone to Lift and Confidence.
What is difference between the Association rule and Recommendation?
Associate rules doesn't extract the individual preference like the recommendation.
Recommendation engine can help to model web user's behavior and predict new user's behavior. Conversion rate is the percentage of visitor's who take desired action.
In association rule mining, it finds interesting relationships among items in given data set.
Association rule provides the analysis of frequently brought products but recommendation system provides either user based means recommendation. for example - if one user (A) watches too many funny videos and B also watches funny videos then system suggest B to watch those funny videos which A has watched as it may be interesting to B. or item based recommendation means if P user purchases a mobile with screen guard and back cover and R user is purchasing the same mobile then system will show screen guard and back cover as recommended product.
Code output
In which industry it is majorly used?
Market Basket Analysis is majorly used in the retail industry to analyze the customer's buying pattern and also used in telecom industry to identify what packages customers are purchasing.
Disadvantage of Apriori algorithm
Apriori algorithm is slow as compared to other algorithms as it scans the database multiple times to find the frequent itemset and it will take more time in larger datasets.
What are other python libraries available in python for Market Basket Analysis?
Considering the disadvantage of Apriori algorithm, we can use fpgrowth as it scans the database only twice and generates the tree like structure also we can consider eclat library for larger datasets.
Comments
Post a Comment