
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

























Market Baskets
Frequent Itemsets
A-priori Algorithm
A large set of
, e.g., things sold in
a supermarket.
A large set of
, each of which is
a small set of the items, e.g., the thingsone customer buys on one day.
Items={milk, coke, pepsi, beer, juice}.
Support = 3 baskets.
B1 = {m, c, b}
B2 = {m, p, j}
B3 = {m, b}
B4 = {c, j}
B5 = {m, p, b}
B6 = {m, c, b, j}
B7 = {c, b, j}
B8 = {b, c}
Frequent itemsets: {m}, {c}, {b}, {j}, {m, b}, {c, b}, {j, c}.
Real market baskets: chain stores keep terabytes of information about whatcustomers buy together.
Tells how typical customers navigatestores, lets them position tempting items.
Suggests tie-in “tricks,” e.g., run sale ondiapers and raise the price of beer.
High support needed, or no $$’s.
“Baskets” = Web pages; “items” = linked pages.
Pairs of pages with many commonreferences may be about the same topic.
“Baskets” = Web pages
; “items” =
pages that link to
Pages with many of the same links may bemirrors or about the same topic.
“Market Baskets” is an abstraction that models any many-many relationshipbetween two concepts: “items” and“baskets.”
Items need not be “contained” in baskets.
The only difference is that we count co- occurrences of items related to abasket, not vice-versa.
If-then rules about the contents of baskets.
1
2
k
means: “if a basket
contains all of
1
k
then it is likely to
contain
of this association rule is
the probability of
given
1
k
B1 = {m, c, b}
B2 = {m, p, j}
B3 = {m, b}
B4 = {c, j}
B5 = {m, p, b}
B6 = {m, c, b, j}
B7 = {c, b, j}
B8 = {b, c}
An association rule:
{m, b}
c
Confidence = 2/4 = 50%.
_ _
B1 = {m, c, b}
B2 = {m, p, j}
B3 = {m, b}
B4 = {c, j}
B5 = {m, p, b}
B6 = {m, c, b, j}
B7 = {c, b, j}
B8 = {b, c}
For association rule
{m, b}
c
, item
appears in 5/8 of the baskets.
Interest = | 2/4 - 5/8 | = 1/8 --- not very interesting.
Rules with high support and confidence may be useful even if they are not“interesting.”
We don’t care if buying bread causes people to buy milk, or whether simply a lotof people buy both bread and milk.
But high interest suggests a cause that might be worth investigating.
Typically, data is kept in a “flat file” rather than a database system.
Stored on disk.
Stored basket-by-basket.
Expand baskets into pairs, triples, etc. asyou read baskets.
17
The true cost of mining disk-resident data is usually the
number of disk I/O’s
In practice, association-rule algorithms read the data in passes --- all basketsread in turn.
Thus, we measure the cost by the number of passes an algorithm takes.
The hardest problem often turns out to be finding the frequent pairs.
We’ll concentrate on how to do that, then discuss extensions to findingfrequent triples, etc.
A simple way to find frequent pairs is:
Read file once, counting in main memorythe occurrences of each pair.
Expand each basket of
n
items into its
n
(
n
-1)/2 pairs.
Fails if #items-squared exceeds main memory.