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
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
290
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
410
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
フルカイテン株式会社 採用資料
fullkaiten
0
40k
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
ハイパーパラメータチューニングって何をしているの
toridori_dev
0
140
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
190
AGIについてChatGPTに聞いてみた
blueb
0
130
いざ、BSC討伐の旅
nikinusu
2
780
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.3k
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
327
21k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
How STYLIGHT went responsive
nonsquared
95
5.2k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
YesSQL, Process and Tooling at Scale
rocio
169
14k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Writing Fast Ruby
sferik
627
61k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
For a Future-Friendly Web
brad_frost
175
9.4k
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