I am performing a market basket analysis of customers and the products they purchased. I did an a priori analysis on all of the transactions on the products they purchased to determine which items are likely bought together.

I have additional attributes (industry, geography, etc.) about the customers (B2B), and I would like to find purchasing trends. For instance, do customers in the financial services industry buy a group of products more frequently than customers in the retail industry (or all customers)?

I can think of three ways to do this, but I am not sure which one is correct:

  1. Add the attributes as an additional product in the transaction (so to speak), so the a priori algorithm itself will determine if there is a relationship between the industry product and the purchased products
  2. Run the a priori analysis on pre-filtered customer transactions based on an attribute (e.g., run it on only retail customer transactions)
  3. Run some other statistical analysis (chi-square?) to determine if a customer group differs
  • $\begingroup$ Please reread and carefully edit your question. It's unclear right now, esp. the "For instance" sentence and point #1. $\endgroup$
    – rolando2
    Apr 29, 2014 at 12:05
  • $\begingroup$ Thanks @rolando2. I've updated the question for clarity. $\endgroup$
    – Brian
    Apr 30, 2014 at 13:00
  • 1
    $\begingroup$ So you have a clients table with client name and attributes (e.g. sector) and then you have a products table with product name/code and atttributes (e.g. colour, size, type, etc.), is that correct ? Can you explain your dataset? $\endgroup$
    – Zhubarb
    Apr 30, 2014 at 13:13
  • $\begingroup$ @Zhubarb, we have a table of clients with attributes (e.g., sector) and the products each client purchased in 2013. We do not know if the client purchased X and then Y -- we only know that they bought X and Y in 2013. There are 50 products. $\endgroup$
    – Brian
    Apr 30, 2014 at 17:37
  • $\begingroup$ Please clarify: are you interested only in a) likelihood of buying the various baskets or, also b) likelihood of buying at different quantity levels, or, also c) likelihood of spending different amounts on purchases of each basket? $\endgroup$ May 5, 2014 at 16:14

1 Answer 1


It really depends on your data.

If you have customer grouped already and there is only few customer groups, then 2. would result in a set of association rules for each customer group. A result easy to understand /explain to others.

Ex.: Customer group X -> buy item Y and Z, 43% of the time

If customers are not grouped already but there is only a few attributes, then 1. makes more sense, resulting in a set of association rules, including the customer attributes. Again an easy-to-understand result.

Ex.: Attribute X -> buys item Y 86% of the time

Though if customers are not grouped, and you have many attributes, then you need to get creative. One solution would be to use some sort of clustering algorithm on the customers first, and then go back to option 2.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.