To explore the relationship between items, one can visualize the association rules. In the following recipe, we introduce how to use the arulesViz
package to visualize association rules.
In this recipe, one has to have completed the previous recipe by generating rules and have these stored in a variable named rules.pruned
.
Please perform the following steps to visualize association rules:
First, install and load the
arulesViz
package:> install.packages("arulesViz") > library(arulesViz)
You can then make a scatterplot from the pruned rules:
> plot(rules.pruned)
We can also present the rules in a grouped matrix:
> plot(rules.pruned,method="grouped")
Alternatively, we can use a graph to present the rules:
> plot(rules.pruned,method="graph")