替代规则图

R 中的购物篮分析

Christopher Bruffaerts

Statistician

基于分组的矩阵可视化

使用 apriori 提取规则

rules = apriori(data_trx, 
                parameter = list(
                  supp = 1/7,
                  conf = 0.6,
                  minlen = 2)
)

grouped 方法

plot(rules, method = "grouped")

grouped

R 中的购物篮分析

基于分组的矩阵可视化

使用不同度量的分组矩阵

plot(rules, 
     method = "grouped",
     measure = "lift",
     shading = "confidence")

grouped2

R 中的购物篮分析

平行坐标图

生成规则并绘图

plot(rules, method = "paracoord")
     lhs              rhs         support  confidence lift  count
[1]  {Bread}          => {Wine}   0.28     0.66       0.93  2    
[2]  {Bread}          => {Butter} 0.42     1          1.16  3    
[3]  {Cheese}         => {Wine}   0.42     0.75       1.05  3    
[4]  {Wine}           => {Cheese} 0.42     0.6        1.05  3    
[5]  {Cheese}         => {Butter} 0.42     0.75       0.87  3    
[6]  {Wine}           => {Butter} 0.57     0.8        0.93  4    
[7]  {Butter}         => {Wine}   0.57     0.66       0.93  4    
[8]  {Bread,Cheese}   => {Wine}   0.14     1          1.4   1    
[9]  {Bread,Cheese}   => {Butter} 0.14     1          1.16  1    
[10] {Bread,Wine}     => {Butter} 0.28     1          1.16  2    
...

平行坐标图

parallel_coordinates

R 中的购物篮分析

ruleExplorer:多功能工具

Shiny 应用

ruleExplorer(rules)

可用图表:

  • 数据表
  • 散点
  • 矩阵
  • 分组
  • 图形

shiny_rule_explorer

R 中的购物篮分析

进一步了解 Shiny

R 中的购物篮分析

一起用 ruleExplorer!

R 中的购物篮分析

Preparing Video For Download...