U2 - Apriori - 5th Sem - DS
U2 - Apriori - 5th Sem - DS
U2 - Apriori - 5th Sem - DS
The primary objective of the apriori algorithm is to create the association rule
between different objects. The association rule describes how two or more
objects are related to one another. Apriori algorithm is also called frequent
pattern mining. Generally, you operate the Apriori algorithm on a database that
consists of a huge number of transactions. Let's understand the apriori algorithm
with the help of an example; suppose you go to Big Bazar and buy different
products. It helps the customers buy their products with ease and increases the
sales performance of the Big Bazar.
There are various methods used for the efficiency of the Apriori algorithm
In hash-based itemset counting, you need to exclude the k-itemset whose equivalent
hashing bucket count is least than the threshold is an infrequent itemset.
Transaction Reduction
In transaction reduction, a transaction not involving any frequent X itemset becomes not
valuable in subsequent scans.
For example, you have 5000 customer transactions in a Zara Store. You have
to calculate the Support, Confidence, and Lift for two products, and you may
say Men's Wear and Women Wears.
Out of 5000 transactions, 300 contain Men's Wear, whereas 700 contain
women's wear, and these 700 transactions include 250 transactions of both
men's & women's wear.
1. Support
Support denotes the average popularity of any product or data item in the data
set. We need to divide the total number of transactions containing that product
by the total number of transactions.
Support (Men's wear)= (transactions relating MW) / (total transaction)
= 300/5000
= 16.67 %
2. Confidence
Confidence is the sum average of transactions/data items present in
pairs/combinations in the universal dataset. To find out confidence, we divide
the number of transactions that comprise both men's & women's wear by the
total number of transactions.
Hence,
Confidence = (Transactions with men's & women's wear) / (total transaction)
= 250/5000
= 5%
3. Lift
It helps find out the ratio of the sales of women's wear when you sell men's
wear. The mathematical equation of lift is mentioned below.
Lift = (Confidence ( Men's wear- women's wear)/ (Support (men's wear)
= 20/18
= 1.11
Mining association rules from frequent item sets
Given a set of transactions, find rules that will predict the occurrence of an item
based on the occurrences of other items in the transaction.
For example, we may have the following products: Milk, Cheese, Bread, Eggs
SETM Algorithm
Apriori Algorithm
AprioriTid Algorithm