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
730
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.4k
recommendation system with document similarity
yoppi
0
3.1k
RailsはRubyだ
yoppi
0
240
Other Decks in Technology
See All in Technology
KMP with Crashlytics
sansantech
PRO
0
240
re:Invent2024 KeynoteのAmazon Q Developer考察
yusukeshimizu
1
150
0→1事業こそPMは営業すべし / pmconf #落選お披露目 / PM should do sales in zero to one
roki_n_
PRO
1
1.5k
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
190
今年一年で頑張ること / What I will do my best this year
pauli
1
220
駆け出しリーダーとしての第一歩〜開発チームとの新しい関わり方〜 / Beginning Journey as Team Leader
kaonavi
0
120
カップ麺の待ち時間(3分)でわかるPartyRockアップデート
ryutakondo
0
140
My small contributions - Fujiwara Tech Conference 2025
ijin
0
1.4k
生成AI × 旅行 LLMを活用した旅行プラン生成・チャットボット
kominet_ava
0
160
自社 200 記事を元に整理した読みやすいテックブログを書くための Tips 集
masakihirose
2
330
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
1
16k
東京Ruby会議12 Ruby と Rust と私 / Tokyo RubyKaigi 12 Ruby, Rust and me
eagletmt
3
870
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
How to Ace a Technical Interview
jacobian
276
23k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Designing Experiences People Love
moore
139
23k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Code Review Best Practice
trishagee
65
17k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Done Done
chrislema
182
16k
Bash Introduction
62gerente
610
210k
A Tale of Four Properties
chriscoyier
157
23k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
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