Академический Документы
Профессиональный Документы
Культура Документы
Sriram. S 16PGM47
Market Basket Analysis Process
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.
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.