Besides listing rules as text, you can visualize association rules, making it easier to find the relationship between itemsets. In the following recipe, we will introduce how to use the aruleViz
package to visualize the association rules.
In this recipe, we will continue using the Groceries
dataset. You need to have completed the previous recipe by generating the pruned rule rules.pruned
.
Perform the following steps to visualize the association rule:
First, you need to install and load the package
arulesViz
:> install.packages("arulesViz") > library(arulesViz)
You can then make a scatter plot from the pruned rules:
> plot(rules.pruned)
Additionally, to prevent overplotting, you can add jitter to the scatter plot:
> plot(rules.pruned, shading="order", control=list(jitter=6))