Finding associations in data with the Apriori algorithm
One of the main goals of data mining and clustering is to learn the implicit relationships in the data. The Apriori algorithm helps to do this by teasing out such relationships into an explicit set of association rules. A common example of this type of analysis is what is done by groceries stores. They analyze receipts to see which items are commonly bought together, and then they can modify the store layout and marketing to suggest the second item once you've decided to buy the first item.
In this recipe, we'll use this algorithm to extract the relationships from the mushroom dataset that we've already seen several times in this chapter.
Getting ready
First, we'll use the same dependencies that we did in the Loading CSV and ARFF files into Weka recipe.
We'll use only one import in our script or REPL:
(import [weka.associations Apriori])
We'll also use the mushroom dataset that we introduced in the Classifying...