Second lecture task

Second lecture task

Use whichever platform you prefer to work on – we will give references and hints for R and for Python.

Mushroom association rules

Download the dataset of mushroom characteristics from the UCI Machine Learning repository.

In R you can get the same data from the arules library through the commands

library(arules)
data("Mushroom")

Task [option 1]

Implement the basic apriori algorithm as described on the slides or as described in Agarwal’s original paper.

Use the Mushroom database to produce at least one size 9 itemset that includes Class=edible. Note that the encoding of the classes can be found in the codebook at the UCI Repository.

Task [option 2]

Using arules and its implementation of the Apriori algorithm, I want you to tell me whether the following three mushrooms are edible or not.

  1. A partial white-veiled mushroom with broad, closely spaced gills.
  2. A partial white-veiled mushroom with closely spaced gills, a single ring and a silky surface below the ring.
  3. A mushroom with smooth surface above the ring.