- Ben Lutkevich,technical writer
Association rules are "if-then" statements that help indicate the likelihood of relationships between data items within large data sets in different types of databases. Association rule mining has a number of applications and is commonly used to discover sales correlationstransaction dataor in medical records.
Use cases for association rules
In data science, association rules are used to find correlations and co-occurrences between data sets. They are ideally used to explain patterns in data from seemingly independent information stores such as relational databases and transactional databases. The use of association rules is sometimes referred to as "association rule mining" or "mining associations".
Here are some practical use cases for association rules:
- Medicine.Doctors can use association rules to help diagnose patients. There are many variables to consider when making a diagnosis, as many diseases share common symptoms. By using association rules and data analysis powered by machine learning, physicians can determine the conditional probability of a given disease by comparing symptom relationships in past case data. As new diagnoses are made, the machine learning model can adjust the rules to reflect the updated data.
- Retail trade.Retailers can collect data on purchasing patterns and record purchase data as item barcodes are scanned by point-of-sale systems. Machine learning models can look for common occurrences in this data to determine which products are most likely to be purchased together. The retailer can then adjust the marketing and sales strategy to take advantage of this information.
- User Experience (UX)-Design.Developers may collect data about how consumers use a website they create. They can then use associations in the data to optimize the website's user interface - for example, by analyzing where users tend to click and what maximizes the likelihood that they will interact with a call-to-action.
- Entertainment.Services like Netflix and Spotify may use association rules to power their content recommendation engines. Machine learning models analyze previous user behavior data for common patterns, develop association rules, and use those rules to recommend content that a user is likely to engage with, or to organize content in a way that is likely to provide the most interesting content for a given user first .
How association rules work
At a basic level, association rule mining involves the use ofmachine learningModels to analyze data for patterns or common occurrences in a database. It identifies common if-then associations that are themselvesfederation rules.
An association rule consists of two parts: an antecedent (if) and a consequent (then). A precursor is an element found in the data. A consequent is an element found in combination with the antecedent.
Association rules are created by searching data for common if-then patterns and using the criteriasupportandtrustto see the most important connections.Support is an indication of how common the elements are in the data. Confidence indicates how often the if-then statements are found to be true. A third metric, calledElevator, can be used to compare confidence to expected confidence, or how often an if-then statement is likely to be found true.
Association rules are computed fromItemsetsthat consist of two or more elements. If rules are built from the analysis of all possible itemsets, there could be so many rules that the rules have little meaning. Thus, association rules are typically created from rules that are well represented in data.
Measures for the effectiveness of association rules
The strength of a particular association rule is measured by two main parameters: support and trust. Support refers to the number of times a particular rule appears in the database being mined. Confidence refers to the frequency with which a given rule will turn out to be true in practice. A rule can have a strong correlation in a dataset because it occurs very frequently but occurs much less frequently when applied. This would be a case of high support but low confidence.
Conversely, a rule may not stand out in a dataset, but continued analysis shows that it is very common. This would be a case of high trust and low support. Using these metrics helps analysts separate causation from correlation and allows them to properly assess a given rule.
A third value parameter, known as the lift value, is the confidence to support ratio. If the lift value is a negative value, there is a negative correlation between the data points. If the value is positive, there is a positive correlation, if the ratio is 1, there is no correlation.
Association Rule Algorithms
Popularalgorithmsthat use association rules include AIS, SETM, Apriori, and variations of the latter.
The AIS algorithm generates and counts itemsets as it scans the data. In transactional data, the AIS algorithm determines which large itemsets contained a transaction, and new candidate itemsets are created by augmenting the large itemsets with other items in the transactional data.
The SETM algorithm also generates candidate itemsets while scanning a database, but this algorithm considers the itemsets at the end of its scan. New candidate itemsets are generated in the same way as with the AIS algorithm, but the transaction ID of the generating transaction is stored sequentially with the candidate itemsetdata structure. At the end of the run, the support count of candidate itemsets is created by aggregating the sequential structure. The disadvantage of both the AIS and SETM algorithms is that according to published materials by Drs. Saed Sayad, author of, can generate and count many small candidate itemsetsReal-time data mining.
With the a priori algorithm, candidate itemsets are generated using only the large itemsets from the previous run. The large itemset from the previous pass is concatenated with itself to produce all itemsets one larger in size. Any item set generated with a non-large subset is then deleted. The remaining itemsets are the candidates. The a priori algorithm also considers each subset of a common itemset as a common itemset. With this approach, the algorithm reduces the number of candidates considered by examining only those itemsets whose support count is greater than the minimum support count, according to Sayad.
Using association rules in data mining
ImData-Mining, association rules are useful to analyze and predict customer behavior. You play an important role in thiscustomer analysis, market basket analysis, product clustering, catalog design and store design.
Programmers use association rules to create programs suitable for machine learning. Machine learning is a type of artificial intelligence (TO), which aims to create programs that can become more efficient without being explicitly programmed.
Examples of association rules in data mining
A classic example of association rule mining relates to a relationship between diapers and beer. The seemingly fictitious example claims that men who go to a store to buy diapers are also likely to buy beer. Data that suggests this might look like this:
A supermarket has 200,000 customer transactions. About 4,000 transactions, or about 2% of the total number of transactions, involve the purchase of diapers. About 5,500 transactions (2.75%) involve the purchase of beer. Of these, about 3,500 transactions, 1.75%, involve the purchase of both diapers and beer. Based on the percentages, that big number should be a lot lower. However, the fact that about 87.5% of diaper purchases involve the purchase of beer indicates a link between diapers and beer.
While the concepts behind association rules can be traced back earlier, association rule mining was defined in the 1990s, when computer scientists Rakesh Agrawal, Tomasz Imieliński and Arun Swami developed an algorithm-based way to find relationships between items using point-of-sale (POS) systems. Applying the algorithms to supermarkets, the scientists were able to discover links between different items purchased, calledfederation rules, and ultimately use this information to predict the likelihood of different products being purchased together.
For retailers, Association Rule Mining provided a way to better understand customer buying behavior. Because of its retail origins, association rule mining is often referred to asShopping cart analysis.
With advances in data science, AI, and machine learning since the original use case for association rules—and more devices are generating data—association rules can be used in a wider range of use cases. More data is generated, which means more applications for association rules. AI and machine learning make it possible to analyze larger and more complex data sets and search for association rules.
This was last updated inSeptember 2020
Read more about association rules
- Clinical analytics platforms simplify healthcare data mining
- 6 tips for effective customer data mining
- Five steps to building better predictive analytics applications
- normal distribution
- A normal distribution is a type of continuous probability distribution in which most of the data points tend towards the middle of the...See full definition
- Operational Intelligence (OI)
- Operational Intelligence (OI) is an approach to data analysis that enables decisions and actions in business operations...See full definition
- A vector is a quantity or phenomenon that has two independent properties: magnitude and direction.See full definition
Dive deeper into data science and analytics
- Consensus AlgorithmVon: RahulAwati
Business-friendly AI regulations need to be global
The government proposes an innovation-friendly AI framework
Through:KlipSaran(Video) Machine Learning | Association Rules
- Bitcoin-MiningVon: AlexanderGillis