Market basket analysis provides great insights into purchasing behaviors of customers. Based on customer purchase data and association rules, we arrive at groups of related products which typically people buy together.
# Load the required libraries install.packages("arules") library(arules) library(datasets) # Load the data set myData
# Fetch the rules with support as 0.001 and confidence as 0.7 rules
rules<-sort(rules, by="confidence", decreasing=TRUE) options(digits=2) inspect(rules[1:10])
#Visualizing the results install.packages("igraph") install.packages("arulesViz") library(arulesViz) library(tcltk) rulesImp
1. Arules Package: http://cran.at.r-project.org/web/packages/arules/arules.pdf
2. ArulesViz Package: http://cran.r-project.org/web/packages/arulesViz/vignettes/arulesViz.pdf