Market Basket Analysis
Association rules are a popular technique for data mining. The association rule algorithm was developed initially by Rakesh Agrawal, Tomasz Imielinski, and Arun Swami at the IBM Almaden Research Center. It was originally designed as an efficient algorithm for finding interesting relationships in large databases of customer transactions. The algorithm finds sets of associations, items that are frequently associated with each other. For example, when analyzing supermarket data, you might find that consumers often purchase eggs and milk together. The algorithm was designed to run efficiently on large databases, especially databases that don’t fit into a computer’s memory.
R includes several algorithms implementing association rules. One of
the most popular is the a priori algorithm. To try it in R, use the
apriori function in the
library(arules) apriori(data, parameter = NULL, appearance = NULL, control = NULL)
Here is a description of the arguments to
|data||An object of class |
|parameter||An object of class |
|appearance||An object of class |
Get R in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.