Trực quan hóa giao dịch và luật

Phân tích giỏ hàng trong R

Christopher Bruffaerts

Statistician

Kiểm tra tương tác

Trích xuất luật

rules = apriori(Groceries, 
                parameter = list(
                  supp=.001,
                  conf=.5,
                  minlen=2,
                  target='rules'
                 ))
# Kiểm tra bằng datatable
inspectDT(rules)

Bảng HTML

DT_groceries

Phân tích giỏ hàng trong R

Scatterplot tương tác

Biểu đồ từ arulesViz

# Vẽ luật dạng scatterplot
plot(rules, method = "scatterplot",
     engine = "html")

Các kiểu biểu đồ khác với method:

  • two-key plot
  • grouped
  • matrix

Scatterplot và khác

Groceries_interactive_scatter

Phân tích giỏ hàng trong R

Đồ thị tương tác

Engine và method

# Vẽ luật dạng đồ thị
plot(rules, method = "graph",
     engine = "html")

đồ_thị_groceries

Phân tích giỏ hàng trong R

Tiểu đồ thị tương tác

Sắp xếp các luật đã trích xuất

# Top 10 luật có độ tin cậy cao nhất
top10_rules_Groceries = 
    head(sort(rules,by = "confidence"), 10)
inspect(top10_rules_Groceries)
# Vẽ top 10 luật
plot(top10_rules_Groceries, 
     method = "graph",  engine = "html")

tiểu_đồ_thị_groceries

Phân tích giỏ hàng trong R

Khám phá luật cho Groceries

rules = apriori(Groceries, parameter=list(supp=0.001, conf=0.8))
ruleExplorer(rules)

shiny_groceries

Phân tích giỏ hàng trong R

Hãy trực quan hóa một số luật phim!

Phân tích giỏ hàng trong R

Preparing Video For Download...