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
720
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
NW-JAWS #14 re:Invent 2024(予選落ち含)で 発表された推しアップデートについて
nagisa53
0
260
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
生成AIをより賢く エンジニアのための RAG入門 - Oracle AI Jam Session #20
kutsushitaneko
4
220
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
530
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
180
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
440
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
530
ハイテク休憩
sat
PRO
2
140
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
520
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Designing for Performance
lara
604
68k
Scaling GitHub
holman
458
140k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
YesSQL, Process and Tooling at Scale
rocio
169
14k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
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