estimating the effect of advertising with machine learning

20
Estimating the Effect of Advertisment by Varian’s approach with R Shota Yasui Japan.R 2015-12-05

Upload: shota-yasui

Post on 15-Apr-2017

14.363 views

Category:

Education


2 download

TRANSCRIPT

Page 1: Estimating the effect of advertising with Machine learning

Estimating the Effect of Advertisment by Varian’s approach with R

Shota Yasui Japan.R 2015-12-05

Page 2: Estimating the effect of advertising with Machine learning
Page 3: Estimating the effect of advertising with Machine learning

広告の効果を機械学習を使って推定するという話。

Page 4: Estimating the effect of advertising with Machine learning

広告の効果をちゃんと推定するのは難しい

Page 5: Estimating the effect of advertising with Machine learning
Page 6: Estimating the effect of advertising with Machine learning
Page 7: Estimating the effect of advertising with Machine learning
Page 8: Estimating the effect of advertising with Machine learning

どちらの方に多く広告を出稿しますか?

Page 9: Estimating the effect of advertising with Machine learning
Page 10: Estimating the effect of advertising with Machine learning

Selection Bias

• マーケターは相性の良さそうなタイミングや場所で多く出稿する。

• この時単純に売り上げの差分を広告の効果と主張するのはNG

カリフォルニア

アリゾナ

Sales

広告の効果?

Page 11: Estimating the effect of advertising with Machine learning

Selection Bias• 効果を推定したい事象がランダムには割り振られていない。

• その事を加味した推定方法を利用しなければ、推定された効果はselection

biasを内包した状態になる。

• こういった状況に対処する為によく使うものが、

• Instrumental Variable Method

• Propensity Score

広告の効果

元々の相性

Page 12: Estimating the effect of advertising with Machine learning

今回はHal Varianが2014年にBig Data: New Tricks

for Econometricsという論文で提唱したアプローチをRでやってみた。

Page 13: Estimating the effect of advertising with Machine learning

データ

• KaggleのRossmann Store Salesのデータを利用する。

• ドイツにあるドラッグストア1115店舗の3年分の売上とそれに関連する店舗の特徴データ。

• このデータの中にPromotionという変数が0 or

1のダミー変数で入ってる

• 今回はこのPromotionの変数が広告であるという仮定を行い分析を進める。

Page 14: Estimating the effect of advertising with Machine learning

Promotion = 0 モデル学習データ

10 hold cv

Promotion = 0の比較対象データ

Promotion = 1 の予測対象データ

モデル学習

未学習のデータとしてモデルに投入して予測値を算出。

結果

1. 比較してみる。

2. Promotion = 1データでの予測値と実売上の差分を見る。

N=37万

N=32万

N=14万

流れ

学習されたモデルを広告が無い世界での売り上げを予測してくれるものだと捉える。

Page 15: Estimating the effect of advertising with Machine learning

モデル

• Gradient Boosting Decision Treeを採用。

• Xgboostパッケージで学習

• 理由は慣れてるから。

• Ntree = 3000 Shrinkage = 0.5 Max.depth = 5

• Log(売上)に対して学習 ⇒ Log(Sales) = f(Features) +

error

• 10 hold CVでrmseが0.07程度。

Page 16: Estimating the effect of advertising with Machine learning

Promotion = 0の比較対象データ

• 横軸がモデルでの予測。 • 縦軸が実際の売上。

※このデータはモデルにとって未知のデータ。

Rmseは0.072

Page 17: Estimating the effect of advertising with Machine learning

• 事象の構造に変化が無ければ、予測はある程度上手く行く。(右) • 事象の構造に変化が有れば、予測はずれる。(左)

• データの差が広告のみであるならば、実際の売上の値とモデルの予測値との乖離が広告の効果であると言える。

Page 18: Estimating the effect of advertising with Machine learning

• Promotion = 1のデータの予測値とlog(sales)の差の平均は0.46

• この値を対数差分の近似として捉えれば、Promotionの効果は平均的に売上に対して46%の増加をもたらすと考えられる。

• ただし、Promotion = 1のデータセットとPromotion = 0のデータセット間で広告の投下と相関しているような差が発生していなければ・・・

• 例えばクリスマスシーズンは全ての店と全ての年で広告を出している状態なら、クリスマスシーズンのデータはPromotion = 1のデータセットにしか入っていない状態になる。

• 結果この46%の増加の中にはクリスマスシーズンというセレクションバイアスが含まれていることになる。

結果のまとめ

Page 19: Estimating the effect of advertising with Machine learning

+α:広告効果の推定値に対しての学習

• Ntree = 500 • Shrinkage = 0.5 • Max.depth = 5

• Store type • 曜日 • 商品の品ぞろえ • 露点 • 競合店との距離

• あたりが広告効果と思われる差分の“予測には”効いてる。

• こういった要素から広告効果の受けやすい店舗とかが解る・・・・・・・かも。

Page 20: Estimating the effect of advertising with Machine learning

Enjoy!