Define the concepts of support and confidence and Lift for an association rule mining.

 SUPPORT, CONFIDENCE AND LIFT

Imagine a Stationery store with tens of thousands of different products. We wouldn't want to calculate all associations between every possible combination of products. Instead, we would want to select only potentially relevant rules from the set of all possible rules. Therefore, we use the measures support, confidence, and lift to reduce the number of associations we need to analyze

1. Support (S): The metric support tells us how popular an itemset is, as measured by the proportion of transactions in which the itemset appears. Support of an itemset calculated as

Number of transactions that contains an itemset Support (s) /Total number of transaction in the given dataset


In our data shown in table 5.1, the support of itemset (Pencil) is,Support (Pencil) / Total hunder of transaction in the given dataset =4/5=0.8-=80% 

The support of itemset (Pencil, Paper) is

Support ((Pencil, Paper]) =Number of transactions that contain an (Pencil, Paper )/Total number of transactions in the given dataset = 3/5=0.6=60%

2. Confidence: Confidence tells us how likely an itemset Y is purchased given that itemset X is purchased expressed as [X-Y]. It is measured by the proportion of transactions with itemset X, in which itemset Y also appears. 

Confidence of an association rule X→Y calculated as:

Confidence (c)=  Number of transactions that contain an itemset (X, Y)/Number of transactions that contain an itemset (X)

For example, the confidence of the association rule (Paper, Book) →(Rubber) is,

Confidence (Paper, Book) → (Rubber)) = Number of transactions that contain an itemset (Paper, Book, Rubber)/ Number of transactions that contain an itemset (Paper, book

Confidence ([Paper, Book) → (Beer)) =2/3=2/3*100=67%

Hence, the confidence can be interpreted as an estimate of the probability P(Y|X). In other words, this is the probability of finding the itemset Y in transactions under the condition that these transactions also contain the itemset X. Confidence is directed and therefore usually gives different values for the rules X-Y and Y→ X. In our example, the confidence that (Rubber) is purchased given that (Paper, Book) is purchased ([Paper, Book)→ (Rubber]) is 2 out of 3, or 67%. This means the conditional probability P((Rubber) | (Paper, Book)) = 67%.

Note that the confidence measure might misrepresent the importance of an association. This is because it only accounts for how popular itemset X is (in our case (Paper, Book)) but not Y (in our case (Rubber)). If (Rubber) is also very popular in general, there will be a higher chance that a transaction containing (Paper, Book) will also contain (Rubber), thus inflating the confidence measure. To account for the base popularity of both items, we use a third measure called lift.

3. Lift: Lift tells us how likely item Y is purchased when item X is purchased while controlling for how popular items Y and X are. It measures how many times more often X and Y occur together than expected if they were statistically independent.

 Lift (X→Y)=; number of transactions that contain an itemset (X, Y)/Support (X) *Support(Y)

If the value of Lift = 1: implies no association between itemsets.

If the value of Lift > 1: greater than 1 means that itemset Y is likely to be  if  itemset X is bought, 

If the value of Lift < 1: less than 1 means that itemset Y is unlikely to be bought if itemset X is bought.

For example, lift for association rule (Paper, Book)-> (Rubber) is calculated as:





Comments

Popular posts from this blog

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Suppose that a data warehouse consists of the four dimensions; date, spectator, location, and game, and the two measures, count and charge, where charge is the fee that a spectator pays when watching a game on a given date. Spectators may be students, adults, or seniors, with each category having its own charge rate. a) Draw a star schema diagram for the data b) Starting with the base cuboid [date; spectator; location; game], what specific OLAP operations should perform in order to list the total charge paid by student spectators at GM Place in 2004?

Suppose that a data warehouse consists of the three dimensions time, doctor, and patient, and the two measures count and charge, where a charge is the fee that a doctor charges a patient for a visit. a) Draw a schema diagram for the above data warehouse using one of the schemas. [star, snowflake, fact constellation] b) Starting with the base cuboid [day, doctor, patient], what specific OLAP operations should be performed in order to list the total fee collected by each doctor in 2004? c) To obtain the same list, write an SQL query assuming the data are stored in a relational database with the schema fee (day, month, year, doctor, hospital, patient, count, charge)