マーケットバスケット分析を最大限に活用する

Rで学ぶマーケットバスケット分析

Christopher Bruffaerts

Statistician

実務でのマーケットバスケット

顧客/ユーザーの理解

  • どの商品が組み合わせて購入されるかを把握
  • ルール集合を抽出
  • 商品間の関係を推測

MBAの発展

  • 顧客/ユーザー情報を追加
  • 嗜好に基づいて顧客をセグメント化(クラスタリング)

顧客/ユーザーへのレコメンド

  • オフライン: よく一緒に買われる商品を近くに配置
  • オンライン: 関連商品を同一ページで提示。ワンクリックで遷移
Rで学ぶマーケットバスケット分析

ヨーグルトに影響したものは?

結果(後件)がヨーグルト

# 右辺がヨーグルトのルールを抽出
yogurt_rules_rhs = apriori(Groceries, parameter = list(supp = 0.001,conf = 0.8),
                           appearance = list(default = "lhs",rhs = "yogurt"))
# リフトが高い順に上位を確認
inspect(head(sort(yogurt_rules_rhs, by="lift")))
    lhs                                                         rhs      support     confidence lift     count
[1] {root vegetables,butter,cream cheese }                   => {yogurt} 0.001016777 0.9090909  6.516698 10   
[2] {tropical fruit,whole milk,butter,sliced cheese}         => {yogurt} 0.001016777 0.9090909  6.516698 10   
[3] {other vegetables,curd,whipped/sour cream,cream cheese } => {yogurt} 0.001016777 0.9090909  6.516698 10   
[4] {tropical fruit,other vegetables,butter,white bread}     => {yogurt} 0.001016777 0.9090909  6.516698 10   
[5] {sausage,pip fruit,sliced cheese}                        => {yogurt} 0.001220132 0.8571429  6.144315 12   
[6] {tropical fruit,whole milk,butter,curd}                  => {yogurt} 0.001220132 0.8571429  6.144315 12
Rで学ぶマーケットバスケット分析

ヨーグルトは何に影響した?

前件がヨーグルト

# 左辺がヨーグルトのルールを抽出
yogurt_rules_lhs = apriori(Groceries, parameter = list(supp = 0.001, conf = 0.8, minlen = 2), 
                                appearance = list(default = "rhs",lhs = "yogurt"))
# ルールの要約
summary(yogurt_rules_lhs)
set of 0 rules
Rで学ぶマーケットバスケット分析

映画のレコメンドを見つけましょう!

Rで学ぶマーケットバスケット分析

Preparing Video For Download...