[MUSIC] Let's practice computing support and confidence. Well this is our formal context. Let's say that a, b, c, d, e, and f are some items in a supermarket. And rows, objects correspond to transactions. So we have 50 people who bought a and f, we have 40 people who bought a, b, and c. 30 people who bought a, b, and d, and so on. Let's compute the support of the set b, e. Well how many objects have both attributes, b and e? Well, none of them. So the support is 0. Now let's look at the implication b, e implies a, d. What is it's confidence? Well because of the support of the premise equals 0, by definition of confidence, the confidence of this implication is 1. And it's always like that, when the premise has support 0 the confidence of the confidence of the implication is 1. So this is a valid implication, because confidence is 1. But it's completely uninteresting, what it tells us even we don't have people who buy at the same time b, e and a, d. But there are no people who buy at the same time b and e in the first place. So it doesn't really make much sense to talk about what these non existent people buy in addition to b and e. But it's not always that an association with the 0 support is uninteresting. So you can see in the following example, let's look at the support of the set b, d. Well we have only one row that has both attributes b and d. And we see that there are 60 people who bought b and d. So we have 30 objects with b and d, so the support is 30. Now, let's look at the implication b, d. Implies e, f. Well, the computer confidence of this implication, of this association rule to be more precise, let's use the definition. So in the numerator we're going to have the support of the union of the d and e, f. So the support of b, d, e, f. And in the numerator we have the support of the premise of b, d. So the support of b, d, f is how many objects have all the four attributes while 0. So it's 0 divided by the support of b, d which is 30. So the confidence is 0, so this implication has both 0 confidence and 0 support. Because the support of this implication of the premise and the conclusion combined. But still this association rules tells us something interesting. It tells us that people who buy b and d never buy e and f, at least together, and this may be useful to know. Let's consider another implication, another association rule, and let me skew the curly brackets from now on. So I'm going to compute the confidence of bd implies a. So in the numerator, we're going to have the number of objects that have attributes a, b, and d together. And there are 30 such objects. And in the denumerator, we have the support of bd which is also 30. So in this case, the confidence is 1. And association rule, with non 0 support, and confidence equal to 1. So it's a valid implication, but it's interesting because its support's non 0, unlike this one. Okay, all the association rules with support and confidence different from 0 and 1. Yes, let's look at these two attributes, e and f. So the support of the associational rule e implies f equals the support of the set ef and so it's 50. What about the support of the sufficient rule f implies e? It's 50 again because again, we have to consider the support of the set ef. But these two implications have different confidences. So the confidence e implies f is the support of ef which is 50 divided by the support of e of the premise of this rule. And the support of e is 50 plus 100. We have 150 people who bought e. So the confidence is one-third. So one-third of those who bought e also bought f. And indeed we can verify that this in the context we have 150 people who bought e, but only 50 of them bought f. What about the confidence of f implies e? Here in the numerator we have again the same 50, the support of f implies e. And in the numerator, we have the number of people who bought f, and this is 50 plus 50, so 100. So here the confidence is one-half. So if were to believe support and confidence then these two implications have the same support. But the second one has a higher confidence and therefore it's more interesting for us, it's more reliable. [MUSIC]