###
Machine Learning Study Node - Association Rules

Last updated: 2017-09-25 19:30:12 PDT.

## Association Rules

An *association rule* is a implication of the form where is the *antecedent* and is the *consequence* of the rule. One example of assoc rules is in *market basket analysis* where we want to find the dependency between two items and in a market.

*Association rule learning* is a method for discovering intersting relations between variables in large databases. It is intended to identify strong rules discovered in databases using some measures of interstingness.

These three measures are frequently calculated:

*Support*of the association rule :*Confidence*of the association rule :*Lift*of the association rule :

Confidence is the conditional probability, which is what we normally calculate. To be able to say that the rule holds with enough confidence, this value should be close to and significantly larger than . We are also interested in maximizing the support of the rule, for if the number of such customers is small, the rule is worthless. If and are independent, then we expect lift the be close to .

We are interested in finding all these rules, There is an efficient algorithm, called Apriori that does this which has two steps:

- finding frequent itemsets, that is, those with enough support, and
- converting them to rules with enough confidence, by splitting the items into two, as items in the antecedent and items in the consequent.

For 1, we begin from the observation that if a set is frequent, all its subsets must be frequent as well. So we can begin from finding all size 1 sets that are frequent, and search inside that range and find all size 2 sets that are frequent and so on.

Once we find the item set, we need to convert them into rules by splitting the items into two as antecedent and censequent. We start by putting a single item in the consequent and items in the antecedent and filter them by confidence threshold. Then inductively we check whether we can move another item from antecedent to the consequent.