Market Basket Analysis
Market basket analysis is a method that allows us to take high-dimensional data and reduce it to something that is simple and manageable without losing too much information along the way. In market basket analysis, our goal is to generate rules that govern the data.
Market basket analysis is also called affinity analysis. It is named after the example of a grocery store trying to do analysis on its customers' transactions – analysis of the products each customer puts in his or her basket. A large grocery store may have something like 5,000 items for sale at any given time. They may have thousands of customers per day. For each customer, the grocery store can keep a record of those customers' transactions. One way to do this would be to use binary encodings, as shown in the following example:
Customer 1's transactions on Day 1:
Peanut Butter: No
Jelly: Yes
Bread: No
Milk: No
…
Customer 2's transactions on Day 1:
Peanut Butter: Yes
Jelly: Yes
Bread: No
Milk: No
...
These transactions...