Visualizing association rules
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.
Getting ready
In this recipe, one has to have completed the previous recipe by generating rules and have these stored in a variable named rules.pruned
.
How to do it…
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")
How it works…
As an alternative...