One of the main goals of data mining and clustering is to learn the relationships implicit in the data. The Apriori algorithm helps to do this by teasing out those relationships into an explicit set of association rules.
In this recipe, we'll use this algorithm to extract the relationships from the mushroom dataset that we've seen several times earlier in this chapter.
First, we'll use the same dependencies that we did in the Loading CSV and ARFF data into Weka recipe.
We'll use just one import in our script or REPL.
(import [weka.associations Apriori])
We'll use the mushroom dataset that we introduced in the Classifying data with decision trees recipe. We'll also set the class
attribute to the column indicating whether the mushroom is edible or poisonous.
(def shrooms (doto (load-arff "data/UCI/mushroom.arff") (.setClassIndex 22)))
Finally, we'll use the defanalysis
macro from the Discovering groups of data using...