-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrocery
33 lines (26 loc) · 896 Bytes
/
grocery
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
install.packages("arules")
library(arules)
install.packages("arulesViz")
library(arulesViz)
grocery<-read.csv("C:/Users/blacksnake/Downloads/groceries.csv")
View(grocery)
rules <- apriori(grocery)
arules::inspect(rules)
rules<-apriori(grocery,parameter = list(minlen=3,supp=0.02,conf=0.5))
arules::inspect(rules)
rules.sorted<-sort(rules,by="lift")
arules::inspect(rules.sorted)
head(quality(rules))
plot(rules,method="scatterplot")
rules_n1<-apriori(grocery,parameter = list(minlen=2,supp=0.1,conf=0.3))
arules::inspect(rules_n1)
rules.sorted_n1<-sort(rules_n1,by="lift")
arules::inspect(rules.sorted_n1)
head(quality(rules_n1))
plot(rules_n1,method="matrix")
rules_n2<-apriori(grocery,parameter = list(minlen=4,supp=0.04,conf=0.4))
arules::inspect(rules_n1)
rules.sorted_n2<-sort(rules_n2,by="lift")
arules::inspect(rules.sorted_n2)
head(quality(rules_n1))
plot(rules_n1,method="graph")