Analisis Keranjang Belanja di R
Christopher Bruffaerts
Statistician
Ekstraksi aturan
rules = apriori(Groceries,
parameter = list(
supp=.001,
conf=.5,
minlen=2,
target='rules'
))
# Inspeksi datatable
inspectDT(rules)
Tabel HTML
Plot dari arulesViz
# Plot aturan sebagai scatterplot
plot(rules, method = "scatterplot",
engine = "html")
Jenis plot lain dengan method:
Scatterplot dan lainnya
Engine dan method
# Plot aturan sebagai graf
plot(rules, method = "graph",
engine = "html")
Mengurutkan aturan yang diekstrak
# 10 aturan teratas dengan confidence tertinggi
top10_rules_Groceries =
head(sort(rules,by = "confidence"), 10)
inspect(top10_rules_Groceries)
# Plot 10 aturan teratas
plot(top10_rules_Groceries,
method = "graph", engine = "html")
rules = apriori(Groceries, parameter=list(supp=0.001, conf=0.8))
ruleExplorer(rules)
Analisis Keranjang Belanja di R