Вы находитесь на странице: 1из 4

Retailing

Sriram. S 16PGM47
Market Basket Analysis Process

Process involved in it are:

 File – open the excel sales data of the transaction for each products.
 After inserting all the data calculate the total for each of the item using
COUNTIF function
 To calculate index:
 Using the formula- =COUNTIF(for single product,1)/Total days of the week
 Do that for each of the product sales.
 To calculate the percentage of each week:
 Use the formula =COUNTIF(total days in week,for each week)/COUNT(total
days in week)
 To calculate the two way lift of actyal total value
 Use the formula- =SUM((product item =1)*(product item=1))
 The value differs for each of the different combinations of the products selected
to find the predicted and the list.
 Using whatif Analysis insert the table from N9, to O9 using the formula
=TABLE(N9,O9)
 DO this for each of the product in the sales data.
 The lift can be calculated using the actual to the predicted value using formula-
=IF(predicted=0,1,Predicted /Actual)
Using shopping basket analysis tool:
Steps involved are:

 Open an Excel table that contains appropriate data. In the sample workbook,
click the Associate worksheet.
 Click Shopping Basket Analysis.
 In the Shopping Basket Analysis dialog box, choose the column that contains
the transaction ID, and then choose the column that contains the items or
products you want to analyze.
 Optionally, you can add a column that contains product values.
 Click-Advanced- open the Advanced Parameters Setting dialog box. Increase
the value for Minimum support to reduce the number of products that are
grouped as itemsets. Increase the Minimum rule probability to filter out very
common itemsets.
Calculating Lifts for Multiple Two-way Product Combinations:

 Enter the range names for any two products in the range N9:O9. The selection of pr
oducts can use the drop-down list in cells N9 and O9.
 In cell Q10 use the formula -
=IF(N9<>O9,VLOOKUP(N9,K9:L14,2,FALSE)*L7*VLOOKUP(O9,K9:L14,2,F
ALSE),0)
to compute the predicted number of transactions involving the two products assumi
ng independence. This formula computes the denominator of first equation. If you c
hoose the same product twice, enter a 0.
 In cell P10 use the array formula =SUM((INDIRECT(N9)=1)*(INDIRECT(O9)=1
)) to compute the number of times the combination of vegetables and fruit occur to
gether. After typing in the formula, press Control+Shift+Enter instead of just Enter
. This formula creates two arrays:
o An array containing 1 whenever the entry in the vegetable column is 1 and 0
otherwise.
o An array containing 1 whenever the entry in the fruit column is 1 and 0 othe
rwise.

This formula causes the arrays to be pairwise multiplied and then the entries in the
resulting array are added together. The pairwise multiplication yields the number of tra
nsactions involving both fruits and vegetables (520).

 In cell R10 compute the total lift for these categories with the formula =IF(Q10=0,
1,P10/Q10). If you chose the same item twice, simply set the lift to equal 1. Otherw
ise, divide actual occurrence of fruits and vegetables together by the predicted num
ber of occurrences.

Taking this one step further, we can use a two-way data table to compute the lift for all
two-product combinations simultaneously.
 In cell O17 place the formula for lift (=R10) that you want to recalculate. R10 cont
ains the lift for a generic two-product combination.
 Select the table range O17:U23.
 Select What-If Analysis from the Data Tools Group on the Data tab and choose Da
ta Table
 From the Data Table dialog box enter N9 as the row input cell and O9 as the colum
n input cell.
 After clicking, you now have the lift for each two-product combination.
Computing Three-Way Lifts

 To illustrate how the concept of lift applies to three or more attributes associated w
ith a transaction, consider calculating the lift for the purchase of baby goods and D
VDs on Thursday.
 We can use the same concept to compute for the superstore data the lift of an arbitr
ary combination of two products and a day of the week.

The following steps are done:

 In cell Q14 use the array formula =SUM((INDIRECT(P13)=$P$14)*(INDIRECT(


N13)=1)*(INDIRECT(O13)=1)) to compute the actual number of transactions invo
lving vegetables and baby goods on Friday. This formula computes three arrays:
o An array containing a 1 if the day of the week matches the number in P14 (
here a 5) and a 0 otherwise.
o An array containing a 1 if the vegetables column contains a 1 and 0 otherwis
e.
o An array containing a 1 if the baby column contains a 1 and 0 otherwise.
 For each row of data the array formula in Q14 creates a new array. Create the new
array element in any row by multiplying the three listed arrays. A 1 is obtained in a
row of the product array if and only if baby goods and vegetables were bought on F
riday.
 Sum up the entries in the product array to yield the actual number of Friday transac
tions where baby goods and vegetables were purchased.
 In cell R14 compute the predicted number of transactions involving baby goods an
d vegetables purchased on Friday with the following formula:
 IF(N13<>O13,VLOOKUP(N13,K9:L14,2,FALSE)*L7*VLOOKUP(O13,K9:L14,
2,FALSE)*VLOOKUP(P14,K17:L23,2),0)
 If you enter the same product class twice, this formula yields a 0. Otherwise, multi
ply (total number of transactions) * (fraction of baby transactions) * (fraction of ve
getable transactions) * (fraction of Friday transactions). This gives a predicted num
ber of Monday meat and vegetable transactions (assuming independence).
 Finally, in cell S14, compute the lift with the formula =IF(R14=0,1,Q14/R14).
 The lift for vegetables and baby goods on Friday is .85. This means that on Friday’
s vegetables and baby goods are bought together less frequently than expected.
Optimizing the Three-Way Lift

 Use Evolutionary Solver with the changing cells being the day of the week (cell P1
4) and an index reflecting the product classes (cells N12 and O12). Cells N12 and O
12 are linked with lookup tables to cells N13:O13. For instance, a 1 in cell N12 ma
kes N13 be vegetables.
 Maximize lift (S14), and then choose N12 and O12 (product classes) to be integers
between 1 and 6. P14 is an integer between 1 and 7.
 Add a constraint that Q14 >= 20 to ensure you count only combinations that occur
a reasonable number of times.
 Set the Mutation Rate to .5.

Вам также может понравиться