Introduction
Finding frequent itemsets is one of the most investigated fields of data mining. The Apriori algorithm is the most established algorithm for Frequent Itemsets Mining (FIM).
Definition of Frequent Itemsets 
A set of items that appears in many baskets is said to be “frequent.” To be formal, we assume there is a number s, called the support threshold. IfI is a set of items, the support for I is the number of baskets for which I is a subset. We sayI is frequent if its support is sor more.
Example:
Lets consider a simple example. Consider the transactions for the following items
Transaction ID

Items purchased

T1

{Apple, Mango,Pears}

T2

{Mango, Pears, Cabbage, Carrots}

T3

{Pears, Carrots,Mango}

T4

{Carrots, Mango}

Next consider the rule that item/itemset is frequently purchased if it occurs at least 50% of the times. So here it should be bought at least 2 times.
So the table now becomes
Transaction ID

Items purchased

T1

{A,M,P}

T2

{M,P,Ca,Cr}

T3

{P,Cr,M}

T4

{Ca,M}

Item

Number of Transactions

A

1

M

3

P

3

Ca

2

Cr

2

Step 2: Now remove all the items that are purchased less than 2 times. So the new table becomes
Item

Number of Transactions

M

3

P

3

Ca

2

Cr

2

Items

MP

MCa

MCr

PCa

PCr

CaCr

Step 4: Now we count how many times each pair as shown in Step 3 occurs in Table 1.
Items

Number of transactions

MP

2

MCa

2

MCr

2

PCa

1

PCr

1

CaCr

1

Items

Number of transactions

MP

2

MCa

2

MCr

2
