# Association Rules by Apriori Algorithm - How to read them?

Let's consider mining of the association rules for basket analysis at a petrol station.

It is obvious that most people buy petrol, some of them something extra.

The following implications are valid:

• 'sandwich' $\to$ 'petrol'
• 'coke' $\to$ 'petrol'
• 'chocolate' $\to$ 'petrol'
• 'newspaper' $\to$ 'petrol'
• $\dots$

Purely logically, the proposition IF someone buys coke at the petrol station THEN he is likely to buy petrol, too.

Obviously, this is not very helpful. Are you aware of any systematic approach how to deal with situations like this?

## 1 Answer

You are correct in your interpretation that $\{coke\} \Rightarrow \{petrol\}$ represents the proposition, or association rule, that:

IF someone buys coke at the petrol station THEN he is likely to buy petrol, too.

To understand this rule a bit more and place it in context in terms of usefulness, there are a few concepts that you might look at. Let $D$ be the dataset, $X$ and $Y$ itemsets and $\{X\} \Rightarrow \{Y\}$ an association rule.

Support , $supp(X)$, is a measure of how frequently the itemset $X$ appears in the dataset as the antecedent/left-hand-side.

$supp(X) = \frac{|\{d \in D ; X \in d\}|}{|D|}$

Confidence , $conf(\{X\} \Rightarrow \{Y\})$, is a measure of how frequently the association rule $\{X\} \Rightarrow \{Y\}$ is true in the dataset.

$conf(\{X\} \Rightarrow \{Y\}) = \frac{supp(X \bigcup Y)}{supp(X)}$

Lift , $lift(\{X\} \Rightarrow \{Y\})$, is a comparison of the observed support to what would be expected if $X$ and $Y$ were independent.

$lift(\{X\} \Rightarrow \{Y\}) = \frac{supp(X \bigcup Y)}{supp(X) \times supp(Y)}$

There are other measures of an association rule's "interestingness" as well such as all-confidence, coverage, entropy, interest, leverage, etc. [2, 3].

Sources

 Tan, Pang-Ning; Kumar, Vipin; and Srivastava, Jaideep; Selecting the right objective measure for association analysis, Information Systems, 29(4):293-313, 2004 DOI:10.1016/S0306-4379(03)00072-3

 Michael Hahsler (2015). A Probabilistic Comparison of Commonly Used Interest Measures for Association Rules. Link