From the course: Data Science Foundations: Data Mining in R

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Apriori

Apriori

- [Instructor] For our first demonstration of association rule mining, we'll use what is by far the most common approach, which is the Apriori algorithm. To demonstrate this, I'm going to load a few packages, including arules for association rules mining, as well as arulesViz, which is for visualizing some of the association rules. So let's load those. Going to set a random seed. And then, let's get the transactional data about groceries from the package. So you see it's loaded there in the environment on the top right. I'm going to save that to df because that lets me reuse some of my code. And then, we'll come down to actually getting the rules. Now, what I'm going to do is I'm going to take the data frame, which has the groceries transactions. I'm going to use the Apriori algorithm, and then I have two parameters that I need to specify. One is the minimum level of support. That is, how common is this overall in…

Contents