Memvisualisasikan metrik

Analisis Keranjang Belanja di R

Christopher Bruffaerts

Statistician

Tabel interaktif dengan metrik

Aturan dari Toko Kelontong

library(arules)
rules = apriori(data_trx, 
                parameter = list(
                  supp = 3/7, conf=0.6, minlen=2)
                )
inspect(rules)

Tabel interaktif

library(arulesViz)
inspectDT(rules)

Tabel HTML

inspect_DT_rule

Analisis Keranjang Belanja di R

Pengantar scatter plot

Inspeksi aturan

inspect(rules)
    lhs         rhs      support   confidence lift      count
[1] {Bread}  => {Butter} 0.4285714 1.0000000  1.1666667 3    
[2] {Cheese} => {Wine}   0.4285714 0.7500000  1.0500000 3    
[3] {Wine}   => {Cheese} 0.4285714 0.6000000  1.0500000 3    
[4] {Cheese} => {Butter} 0.4285714 0.7500000  0.8750000 3    
[5] {Wine}   => {Butter} 0.5714286 0.8000000  0.9333333 4    
[6] {Butter} => {Wine}   0.5714286 0.6666667  0.9333333 4

Scatter plot dari arulesViz

plot(rules)

scatter_grocery

Analisis Keranjang Belanja di R

Plot arules yang fleksibel

Opsi plot

plot(rulesObject, measure, shading, method)
  • rulesObject: objek aturan yang akan diplot
  • measure: Ukuran ketertarikan aturan (support, confidence, lift, ...)
  • shading: Ukuran untuk mewarnai titik
  • method: Metode visualisasi yang digunakan ("scatterplot", "matrix", "two-key plot", "matrix3D")

Contoh

plot(rules, measure = c("confidence", "lift"),
     shading = "support",
     method = "scatterplot")

scatter_grocery_plot

Analisis Keranjang Belanja di R

Plot arules lainnya

Plot two-key

plot(rules, method = "two-key plot")

two_key_plot

Analisis Keranjang Belanja di R

Menambahkan jitter pada plot

Tanpa jitter

plot(rules, method = "two-key plot")

two_key_plot

Dengan jitter

plot(rules, method = "two-key plot",jitter = 2)

two_key_plot_jitter

Analisis Keranjang Belanja di R

Plot arules interaktif

Aturan interaktif

plot(rules, engine = "plotly")

Dari statis ke interaktif

rules_plotly

Analisis Keranjang Belanja di R

Mari visualisasikan metrik!

Analisis Keranjang Belanja di R

Preparing Video For Download...