June 2017
Beginner to intermediate
576 pages
15h 22m
English
As we did before, we can look at some of the subsets by parsing the left or right side.
For example, we might be interested in seeing what items yielded purchasing chocolate things:
Subset the rules set using the %pin% operator (partial match), and look for any transactions where chocolate appears in the right-hand side:
purchased.this <- "Chocolate" lhs.rules <- subset(rules1, subset = rhs %pin% purchased.this)
Printing lhs.rules shows that there are 487 of them:
print(lhs.rules) > set of 487 rules
Sort them by lift, inspect them, and plot the first 15 as a graph:
lhs.rules <- sort(lhs.rules, by = "lift")inspect(head(sort(lhs.rules, by = "lift"))) > lhs rhs support confidence lift > 1 {CakeTowelSpots} ...