Apriori Algorithm is used in finding frequent itemsets. Identifying associations between items in a dataset of transactions can be useful in various data mining tasks. For example, a supermarket can make better shelf arrangement if they know which items are purchased together frequently. The challenge is that given a dataset D having T transactions each with n number of attributes, how to find itemsets that appear frequently in D? This can be trivially solved by generating all possible itemsets (and checking each of the candidate itemset against support threshold.) which is computationally expensive.
Apriori algorithm effectively eliminates majority of itemsets without counting their suppor

Here is an implementation to get all subsets of a set in Scheme:

(define (subsets s)

(if (null? s)

(list ‘())

(let ((rest (subsets (cdr s))))

(append rest (map (lambda (x) (cons (car s) x)) rest)))))

A very nice and clear explanation. I will try to implement the algorithm in Scheme.

I have a question:

What is the mathematical reason of dividing by “total transactions” while calculating the support value?

In this example only absolute support value is used, that is if an itemset appears 3 times support is stated as 3. But if you want to generalize support calculation, you need to use this formula. Obviously, denominator is total number of TXNs because we want to figure out how frequent an itemset is!