Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Applying oCPC algorithm for production
Search
yoppi
August 12, 2018
Technology
2
710
Applying oCPC algorithm for production
yoppi
August 12, 2018
Tweet
Share
More Decks by yoppi
See All by yoppi
solving of multi-armed bandit problem in advertisement recommendation
yoppi
2
7.3k
recommendation system with document similarity
yoppi
0
3.1k
RailsはRubyだ
yoppi
0
230
Other Decks in Technology
See All in Technology
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
390
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
3
620
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
9
1.1k
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
760
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
AGIについてChatGPTに聞いてみた
blueb
0
130
Featured
See All Featured
Speed Design
sergeychernyshev
25
620
The World Runs on Bad Software
bkeepers
PRO
65
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Git: the NoSQL Database
bkeepers
PRO
427
64k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Building Adaptive Systems
keathley
38
2.3k
Ruby is Unlike a Banana
tanoku
97
11k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
98
Teambox: Starting and Learning
jrom
133
8.8k
Transcript
OCPCΛຊ൪ڥʹద༻͢ Δ·Ͱ @YOPPIBLOG ADOKEN#1
ࣗݾհ IMPORT “GITHUB.COM/YOPPI" ▸ ٛా തҰ @yoppiblog ▸ Speee, Inc.
Engineer ▸ ࠷ۙΞυςΫք۾ʹ͍ͯɺࠓUZOUͷϨίϝϯυΤϯδ ϯͱ͔࡞͍ͬͯ·͢ ▸ Go͕͖
OCPCΛຊ൪ڥʹద༻͢Δ·Ͱ ࠓͷ͓ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞ ▸ γϛϡϨʔγϣϯʹΑΔݕূ
▸ ຊ൪ڥͰͷ࣮ ▸ A/BςετͰͷϞχλϦϯάͱੳ ▸ ݱঢ়ͷ՝ͱࠓޙͷํ
OCPCΛຊ൪ڥʹద༻͢Δ·Ͱ ࠓͷ͓ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞ ▸ γϛϡϨʔγϣϯʹΑΔݕূ
▸ ຊ൪ڥͰͷ࣮ ▸ A/BςετͰͷϞχλϦϯάͱੳ ▸ ݱঢ়ͷ՝ͱࠓޙͷํ
OCPCʹ͍ͭͯ OCPC ▸ Optimize CPCͷݺশ ▸ ೖߘ͞ΕͨࠂͷඪCPAͷୡͱ৴ֹۚͷ࠷େԽΛࢦͨ͢ΊʹࣗಈͰCPCೖ ࡳ͢Δػೳ ▸ جຊతʹCPA͕ѱԽ͢ΔͱͦͷΞυωοτϫʔΫͰͷ৴͕ࢭ·Δ
▸ CPAΛୡͤ͞Α͏ͱCPCΛखಈௐͰ͖ͳ͘ͳ͍͕৴໘͕ଟྔͳͨΊਓख Ͱͷௐඇݱ࣮త ▸ ސ٬ͷຬΛ্͢ΔͨΊʹϓϩμΫτͷ࣭ʢརӹʣΛ্͢ΔͨΊʹػೳͱ͠ ࣮ͯ͞Ε͍ͯΔ͖ ▸ ͱ͍͑ඪCPAΛݱ࣮ʹ͙ͦΘͳֹ͍ۚͰઃఆ͞ΕͨͷΛͳΜͱ͔͢ΔػೳͰ ͳ͍͜ͱલఏ
OCPCʹ͍ͭͯ OCPCΛ࣮͍ͯ͠Δڝ߹ଞࣾ ▸ جຊతʹCPAͷվળٴͼӡ༻ͷݮͱ͍͏Ґஔ͚ͮͰ UZOUͦ͜Λΰʔϧͱ͢ΔͷมΘΒͳ͍ ▸ Outbrain ▸ Logly ▸
Smart News ▸ LINE Ads
OCPCΛຊ൪ڥʹద༻͢Δ·Ͱ ࠓͷ͓ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞ ▸ γϛϡϨʔγϣϯʹΑΔݕূ
▸ ຊ൪ڥͰͷ࣮ ▸ A/BςετͰͷϞχλϦϯάͱੳ ▸ ࠓޙͷ՝ͱ·ͱΊ
ௐࠪ ௐࠪ ▸ طଘͷϓϩμΫτจͷௐࠪ ▸ จΛย͔ͬΒಡΜͰ͍͘ ▸ “Optimal Real-Time Bidding
for Display Advertising” ͔ͳΓے͕ྑ͍ํ๏ͰࠓճͷϞσϧͷϕʔεʹͳ͍ͬͯΔ ▸ http://wnzhang.net/papers/ortb-kdd.pdf
ௐࠪ OPTIMAL REAL-TIME BIDDING FOR DISPLAY ADVERTISING ▸ ੍͖݅ඇઢܗ࠷దԽΛద༻ͯ͠RTBΛղ͍͍ͯΔ ▸
ొਓ ▸ Winning RateʢeCPM͕͍͘ΒͳΒଞͷࠂʹউͬͯ໘ʹͰΔͷ͔ʣ ▸ ༧ଌCTRʢະདྷͷCTRʣ ▸ ༧ଌCVRʢະདྷͷCVRʣ ▸ ϥάϥϯδϡະఆʢϥάϥϯδϡະఆ๏Ͱղ͘ࡍʹ༩͞Ε ͑Δมʣ
OCPCΛຊ൪ڥʹద༻͢Δ·Ͱ ࠓͷ͓ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞ ▸ γϛϡϨʔγϣϯʹΑΔݕূ
▸ ຊ൪ڥͰͷ࣮ ▸ A/BςετͰͷϞχλϦϯάͱੳ ▸ ݱঢ়ͷ՝ͱ·ͱΊ
Ϟσϧͷ࡞ Ϟσϧ࡞ ▸ ੍͖ඇઢܗ࠷దԽͱͯ͠ཧϞσϧΛ࡞ͬͯղ͘ ▸ తؔɺ੍݅Λઃఆ͠ɺ੍݅Λຬͨͭͭ͠ తؔΛ࠷େԽ͢ΔʢCPCՁ֨Λ࠷దԽ͢Δʣ͜ͱ͕ ΰʔϧʹͳΔ f(bix )
= T N ∑ i=1 bix W(bix , ˜ θix ) ˜ θix pi T N ∑ i=1 bix W(bix , ˜ θix ) ˜ θix pi ≤ rx T N ∑ i=1 θix W(bix , ˜ θix ) ˜ θix pi తؔ ੍݅
Ϟσϧͷ࡞ ੍͖ඇઢܗ࠷దԽ ▸ ࠷దԽͷ͏ͪඇઢܗͳͷΛඇઢܗ࠷దԽͱݺ Ϳ ▸ ϥάϥϯδϡະఆ๏ͰύϥϝʔλΛٻΊΔ͜ͱͰۙࣅ ղΛಘΒΕΔ ▸ ࠓճeCPMউϞσϧΛ
ͱஔ͍͍ͯΔͷͰತؔ ͱͳΓχϡʔτϯ๏ͰϥάϥϯδϡະఆΛٻΊ͍ͯ Δ y = x x + l
Ϟσϧͷ࡞ ECPMউϞσϧ ▸ ͲͷeCPMͳΒ৴͞ΕΔʢΦʔΫγϣϯʹউͭʣͰ͋Ζ͏ Ϟσϧ ▸ త͕ؔತؔʹͳΔΑ͏ͳ୯७ͳඇઢܗؔ༻͍ͯ࠷খ ೋ๏Ͱ࡞ ▸ ತؔඍՄೳʹͳΓ࠷దԽܭࢉͰۃܭࢉʹ͓͍ͯ
ߴʹऩଋͤ͞͞ΕΔχϡʔτϯ๏͕͑ΔͨΊ
Ϟσϧͷ࡞ CTR༧ଌɾCVR༧ଌ ▸ ະདྷͷbidՁ֨Λೖࡳ͢ΔͨΊະདྷͷCTRɾCVRΛࢉग़͢Δඞཁ͕͋Δ ▸ ࣄલ͔ΒࣄޙΛβ༻͍ͯࢉग़ͦ͠ΕΛ༧ଌͱͯ͠༻ ▸ ৴ΞϧΰϦζϜͷҰͭͰଟόϯσΟοτ(Thompson Sampling)ʹͯ CTR༧ଌΛ͍ͯ͠Δͷ͕ͱͯੑೳ͕͍͍ͷͰͦͷ··ྲྀ༻͍ͯ͠Δ
▸ https://tech.speee.jp/entry/2018/08/08/090000 ▸ ECαΠτͰ͋ΔλΦόΦʢΞϦόόʣͷࠂϦΞϧλΠϜʹ༧ଌͯ͠ ͍Δ͜ͱΛհ͍ͯ͠Δ ▸ https://arxiv.org/pdf/1703.02091.pdf
OCPCΛຊ൪ڥʹద༻͢Δ·Ͱ ࠓͷ͓ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞ ▸ γϛϡϨʔγϣϯʹΑΔݕূ
▸ ຊ൪ڥͰͷ࣮ ▸ A/BςετͰͷϞχλϦϯάͱੳ ▸ ࠓޙͷ՝ͱ·ͱΊ
γϛϡϨʔγϣϯʹΑΔݕূ γϛϡϨʔγϣϯʹΑΔݕূ ▸ ࣮ࡍʹoCPCϞσϧΛ࡞ͯ͠ҎԼͷ߲Λݕূ͢ΔͨΊʹγ ϛϡϨʔγϣϯʹ͓͍ͯݕূ ▸ ඪCPAΛୡͰ͖Δ͔Ͳ͏͔ ▸ ࠓճͷҰ൪ղܾ͍ͨ͠త ▸
৴ֹۚΛ࠷େԽͰ͖Δ͔Ͳ͏͔ ▸ ඪCPAΛୡ͍ͯͯ͠৴͞Εͳ͚ΕརӹʹͳΒ ͳ͍
γϛϡϨʔγϣϯʹΑΔݕূ γϛϡϨʔγϣϯͷ࣮ ▸ γϛϡϨʔγϣϯϑϨʔϜϫʔΫಛʹ࠾༻ͤͣɺPythonͰ ϑϧεΫϥονͰ࣮ ▸ ࡞ͨ͠ϞσϧͰCPCΛೖࡳͯ͠ ▸ ֤छϨίϝϯυΞϧΰϦζϜͰࠂΛநબ͠৴ ▸
Λ܁Γฦ͢୯७ͳͷ
γϛϡϨʔγϣϯʹΑΔݕূ ࣗલ࣮ͷPROS/CONS ▸ PROS ▸ ಛʹϥΠϒϥϦΛΘͣʹ࡞ͬͨͷͰॊೈʹ࣮Ͱ͖ͨ ▸ ࠂΛநબ͢Δ෦ͦͷޙͷclickͷൃੜΛ੍ޚ͢Δඞཁ͕͋Δͷ ͰUZOUͷγεςϜʹدΓఴͬͨͷΛ࡞ͬͨ΄͏͕ྑ͍ͷʹͳΔ ▸
CONS ▸ ൚༻ԽͰ͖Δͷʹͳ͍ͬͯͳ͍ ▸ ࠓճͷoCPCʹಛԽͨ͠࡞Γʹͳ͍ͬͯΔͷͰଞͷϓϩδΣΫτͰ ͦͷ··͑ͳ͍
ຊ൪ڥͰͷ࣮ ࣮ڥ ▸ γϛϡϨʔγϣϯͱಉ͘͡PythonͰ࣮ ▸ ϦΞϧλΠϜͰͷbid͓ͯ͠Βͣόονܗࣜ
ຊ൪ڥͰͷ࣮ ͳΔ࣮͘ߦ࣌ؒΛ͘͢Δ ▸ σʔλιʔε͔ΒͦΕͳΓͷσʔλΛऔಘ͢Δඞཁ͕͋Δ ▸ SQLΛͯ͠PythonଆͰͳΔ͘ܭࢉͤ͞ͳ͍Α͏ʹ ▸ ཧϞσϧΛܭࢉ͢Δͱ͖NumPy.arrayͰߴʹܭࢉͰ͖ΔΑ͏ʹ ▸ ѻ͏σʔλ͕ଟ͍ͷͰຊདྷͳΒO(mn)ڐ༰͢Δͱ͜ΖΛO(n)ʹ
͢ΔΑ͏ʹఆ߲ΛͳΔ͘ഉআ͢ΔΑ͏ʹ ▸ ͦͦχϡʔτϯ๏Λ࠾༻͍ͯ͠ΔͷͰऩଋ͕ͱͯߴʢ͍ͩ ͍ͨճͷΠςϨʔγϣϯͰऩଋ͍ͯ͠Δʣ
OCPCΛຊ൪ڥʹద༻͢Δ·Ͱ ࠓͷ͓ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞ ▸ γϛϡϨʔγϣϯʹΑΔݕূ
▸ ຊ൪ڥͰͷ࣮ ▸ A/BςετͰͷϞχλϦϯάͱੳ ▸ ݱঢ়ͷ՝ͱ·ͱΊ
A/BςετͰͷಈ͖ํ A/BςετͰͷϞχλϦϯάͱੳ ▸ A/BςετΛ։࢝ͯ͠ɺ͏·͍ͬͯ͘Δࠂओͱ͏·͍ͬ͘ ͍͔ͯͳ͍ࠂओ͕ൃੜ ▸ ΞϧΰϦζϜۜͷؙͰͳ͍ͷͰԿ͕Өڹ͍ͯ͠Δͷ ͔ੳ͢Δඞཁ͕͋Δʢ͔͜͜Β͕Ή͠Ζຊ൪ ▸ ϞχλϦϯάμογϡϘʔυΛ࡞Γ࣌ͰՌΛੳ
▸ μογϡϘʔυҎ֎Ͱadhoc(Jupyter Notebook)Ͱ ੳ͍ͯ͠Δ
A/BςετͰͷಈ͖ํ ϞχλϦϯάπʔϧ ▸ dashΛ༻ ▸ Pythonʢflaskͷ্ʹಠࣗͷϑϨʔϜϫʔΫΛ͍ͤͯ Δʣ ▸ SPAͰಈ͘ʢReactͷίϯϙʔωϯτΛPythonͰॻ͚Δʣ SSR
OCPCΛຊ൪ڥʹద༻͢Δ·Ͱ ࠓͷ͓ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞ ▸ γϛϡϨʔγϣϯʹΑΔݕূ
▸ ຊ൪ڥͰͷ࣮ ▸ A/BςετͰͷϞχλϦϯάͱੳ ▸ ݱঢ়ͷ՝ͱࠓޙͷํ
ݱঢ়ͷ՝ͱࠓޙͷํ A/Bςετ݁Ռ ▸ ͏·͍͍ͬͯ͘Δࠂओ͍Ε ▸ ඪCPAΛୡ͍ͯͯ͠৴ֹۚͰ͍ͯΔ ▸ ͏·͍͍ͬͯ͘ͳ͍ࠂओ͍Δ ▸ ඪCPAୡ͍ͯ͠Δ͕৴ֹ͕ۚग़͍ͯͳ͍ͷ͕ଟ
͍
ݱঢ়ͷ՝ͱࠓޙͷํ ͏·͍͍ͬͯ͘Δͷͱͦ͏Ͱͳ͍ͷΛੳ ▸ جຊతʹ͏·͍͍ͬͯ͘ͳ͍ͷ৴ྔ͕গͳ͍ ▸ ຊདྷ͋Δ͖ਅͷCPCʹಧ͔ͣෛ͚ͯ͠·ͬͯ৴͞Εͳ ͍ঢ়ଶ
ݱঢ়ͷ՝ͱࠓޙͷํ ਅͷCPCͱBID CPCͷൺֱ
ݱঢ়ͷ՝ͱࠓޙͷํ ਅͷCPCͱBID CPCͷൺֱ
ݱঢ়ͷ՝ͱࠓޙͷํ ਅͷCTRͱ༧ଌCTRͷ
ݱঢ়ͷ՝ͱࠓޙͷํ ਅͷCVRͱ༧ଌCVRɾ৴ֹׂۚ߹ͷ
ݱঢ়ͷ՝ͱࠓޙͷํ ECPMউϞσϧͷਫ਼ੳ
ݱঢ়ͷ՝ͱࠓޙͷํ ϞσϧͷվળҊ ▸ ༧ଌCVRͱeCPMউϞσϧ͕ѱͦ͏ͱݴ͑ΔͷͰ͜͜Λվળ͍ͯ͘͠ ▸ ༧ଌCVRͷࣄલͷվળ ▸ eCPMউϞσϧΛվળ ▸ StepModelͱConstantModelͷࠞ߹ϞσϧΘΓͱྑͦ͞͏͕ͩ
ತؔͰͳ͘ͳΔͷͰχϡʔτϯ๏͕͑͘ͳΓSGDʹΓସ ͑Δඞཁ͋Γ ▸ https://media.readthedocs.org/pdf/lmfit-py/0.9.3/lmfit-py.pdf
ڊਓͷݞʹΔ ͦͷଞͷࢀߟจݙ ▸ ࠷దԽೖ https://www.slideshare.net/tkm2261/ss-42149384 ▸ ͜ΕͳΒΘ͔Δ࠷దԽֶ https://www.amazon.co.jp/dp/ 4320017862/ ▸
ඇઢܗ࠷దԽͷجૅ https://www.amazon.co.jp/dp/4254280017/ ▸ ತؔʹ͍ͭͯ http://www2.kaiyodai.ac.jp/~yoshi-s/Lectures/ Optimization/2013/lecture_1.pdf