Академический Документы
Профессиональный Документы
Культура Документы
I purchase diapers I purchase a new car I purchase OTC cough medicine I purchase a prescription medication I dont show up for class
Customers who bought X also bought Y What symptoms go with what diagnosis
Transaction-based or event-based Also called market basket analysis and affinity analysis Originated with study of customer transactions databases to determine associations among items purchased
Basket data consist of collection of transaction date and items bought in a transaction
Itemset Pivoting
Retail organizations interested in generating qualified decisions and strategy based on analysis of transaction data
what to put on sale, how to place merchandise on shelves for maximizing profit, customer segmentation based on buying pattern
4
Examples
diapers beer
Customers who purchase maintenance agreements are very likely to purchase large appliances When a new hardware store opens, one of the most commonly sold items is toilet bowl cleaners
Evaluation
Support : measure of how often the collection of items in an association occur together as a percentage of all the transactions
In 2% of the purchases at hardware store, both pick and shovel were bought support = #tuples(LHS, RHS)/N
Confidence : confidence of rule B given A is a measure of how much more likely it is that B occurs when A has occurred
100% meaning that B always occurs if A has occurred confidence = #tuples(LHS, RHS) / #tuples(LHS) Example: bread and butter milk [90%, 1%]
Rules originating from the same itemset have identical support but can have different confidence
6
support greater than a specified minimum and confidence greater than a specified minimum
Examples
Rule form:
Example
Large Itemsets with minsup=30%
Tr# Items T1 Beer, Milk
T2
T3 T4
Bread, Butter
Bread, Butter, Jelly Bread, Butter, Milk
T5
Beer, Bread
Support 80 60 40 40 60
Consider the itemset {Bread, Butter}, and the two possible rules Bread Butter Butter Bread
Is support and confidence enough? Lift (improvement) tells us how much better a rule is at predicting the result than just assuming the result in the first place
When lift > 1 then the rule is better at predicting the result than guessing
When lift < 1, the rule is doing worse than informed guessing and using the Negative Rule produces a better rule than guessing
10
How many combinations are there with 3 different menu items? 161,700 !
Use of product hierarchies (groupings) helps address this common issue Also, the number of transactions in a given time-period could also be huge (hence expensive to analyze)
11
12
13
Search Approach
Two sub-problems in discovering all association rules:
Find all sets of items (itemsets) that have transaction support above minimum support
Itemsets that qualify are called large itemsets, and all others small itemsets.
Generate from each large itemset, rules that use items from the large itemset.
Given a large itemset Y, and X is a subset of Y Take the support of Y and divide it by the support of X If the ratio c is at least minconf, then X (Y - X) is satisfied with confidence factor c
14
principle:
15
Progressively identifies large itemsets of different sizes Exploits the property that any subset of a large itemset is also a large itemset
AB
AC
AD
BC
BD
CD
ABC
ABD
ACD
BCD
ABCD
16
17
Generating Rules
18
Terms
IF part = antecedent THEN part = consequent
Item set = the items (e.g., products) comprising the antecedent or consequent
19
20
21
Ideally, we want to create all possible combinations of items Problem: computation time grows exponentially as # items increases
Solution: consider only frequent item sets Criterion for frequent: support
22
Support
Support = # (or percent) of transactions
that include both the antecedent and the consequent Example: support for the item set {red, white} is 4 out of 10 transactions, or 40%
23
Apriori Algorithm
24
Measures of Performance
Confidence: the % of antecedent transactions
that also have the consequent item set
Lift > 1 indicates a rule that is useful in finding consequent items sets (i.e., more useful than just selecting transactions randomly)
26
27
28
30
Interpretation
33
Retail each customer purchases different set of products, different quantities, different times MBA uses this information to:
Identify who customers are (not by name) Understand why they make certain purchases Gain insight about its merchandise (products):
Take action:
Fast and slow movers Products which are purchased together Products which might benefit from promotion
Combining all of this with a customer loyalty card it becomes even more valuable
34
Association Rules
DM technique most closely allied with Market Basket Analysis AR can be automatically generated
AR represent patterns in the data without a specified target variable Good example of undirected data mining
35
36
Support of the rule: the percentage of all baskets that contain both product Y and Z
support = P(Y Z).
Confidence of the rule: the percentage of all the baskets containing Y that also
contain Z. Hence, confidence is a conditional probability, i.e. P(Z|Y) confidence = P(Y Z)/P(Y).
Interest of the rule: measures the statistical dependence of the rule, by relating the
observed frequency of occurrence (P(Y Z)) to the expected frequency of cooccurrence under the assumption of conditional independence of Y and Z (P(Y)*P(Z)) interest = P(Y Z)/(P(Y)*P(Z)). Association-rule discovery is the process of finding strong product associations with a minimum support and/or confidence and an interest of at least one.
37
38
A certainty measure for association rules of the form A => B, where A and B are sets of items, is confidence. Given a set of task
39
What % of customers have purchased Avg # orders/customer include it Avg quantity of it purchased/order
Transaction Data
Etc
41
Did the order use gift wrap? Billing address same as Shipping address? Did purchaser accept/decline a cross-sell? What is the most common item found on a one-item order? What is the most common item found on a multiitem order? What is the most common item for repeat customer purchases? How has ordering of an item changed over time? How does the ordering of an item vary geographically?
42
Association Rules
Wal-Mart customers who purchase Barbie dolls have a 60% likelihood of also purchasing one of three types of candy bars Customers who purchase maintenance agreements are very likely to purchase large appliances When a new hardware store opens, one of the most commonly sold items is toilet bowl cleaners
43
Association Rules
Actionable Rules contain high-quality, actionable information Trivial Rules information already wellknown by those familiar with the business Inexplicable Rules no explanation and do not suggest action
POS Transactions
Co-occurrence of Products
Soda 2 1 0 Detergent 2 0 0
Soda
Detergent
2
2
1
0
0
0
3
1
1
2
45
Simple patterns: 1. Coke and soda are more likely purchased together than any other two items 2. Detergent is never purchased with milk or window cleaner 3. Milk is never purchased with soda or detergent
46
Items Purchased Coke, soda Milk, Coke, window cleaner Coke, detergent Coke, detergent, soda Window cleaner, soda
POS Transactions
If a customer purchases soda, then customer also purchases Coke 2 out of 3 soda purchases also include Coke, so 67% 2 out of 4 Coke purchases also include soda, so 50%
Confidence = Ratio of the number of transactions with all the items to the number of transactions with just the if items
47
Lift (improvement) tells us how much better a rule is at predicting the result than just assuming the result in the first place
Lift is the ratio of the records that support the entire rule to the number that would be expected, assuming there was no relationship between the products Calculating liftWhen lift > 1 then the rule is better at predicting the result than guessing When lift < 1, the rule is doing worse than informed guessing and using the Negative Rule produces a better rule than guessing
48
Choosing the right set of items Generating rules by deciphering the counts in the co-occurrence matrix Overcoming the practical limits imposed by thousands or tens of thousands of unique items
2.
3.
49
Generate co-occurrence matrix for single itemsif Coke then soda Generate co-occurrence matrix for two itemsif Coke and Milk then
soda
3.
4.
Generate co-occurrence matrix for three itemsif Coke and Milk and Window Cleaner then soda Etc
50
How many combinations are there with 3 different menu items? 161,700 !
Use of product hierarchies (groupings) helps address this common issue Finally, know that the number of transactions in a given time-period could also be huge (hence expensive to analyze)
51
52
53
54
55
56
57
58
59
General Observations
Banking case seems to provide well defined and intelligible information of the form:
account_1
and account_2,,, etc or activity_1 and activity_2, etc, possibly indexed by time. As such, rules found provide guide to action to .offer. product or service (cross-sell).
60
In retailing case of items purchased together, .guidance. is not so clear cut due to extensive number of rules.
61
Challenges
A major difficulty is that a large number of the rules found may be trivial for anyone familiar with the business
The computational complexity involved in calculating the results of market basket analysis is at least the square of the number of transaction item-lines (records of every item purchased.) With data warehouses storing billions of transaction lines, this yields extremely high computational requirements
62
Solutions
Differential market basket analysis can find interesting results and can also eliminate the problem of a potentially high volume of trivial results Special techniques involving filtering or aggregation of the transaction database are commonly used to in analysis algorithms to increase performance and allow some level of interactivity, such as in business intelligence applications.
63
Thank You!
64