$30 off During Our Annual Pro Sale. View Details »
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
宇宙最速のランチRecap LT会(AWS re:Invent 2024)
watany
1
360
Explain EXPLAIN
keiko713
10
2.7k
【AWS re:Invent 2024】Amazon Bedrock アップデート総まとめ
minorun365
PRO
7
550
12/3(火)のBedrockアプデ速報(re:Invent 2024 Daily re:Cap #2 with AWS Heroes)
minorun365
PRO
4
140
.NET のUnified AI Building Blocks 入門...!
okazuki
0
190
ARRが3年で10倍になったプロダクト開発とAI活用の軌跡
akiroom
0
240
My Generation 年配者がこの先生きのこるには (Developers CAREER Boost 2024 Edition)/My Generation How elder engineers can survive
kwappa
3
360
Will Positron accelerate us?
lycorptech_jp
PRO
1
120
12/4(水)のBedrockアプデ速報(re:Invent 2024 Daily re:Cap #3 with AWS Heroes)
minorun365
PRO
2
420
re:Invent2024のIaC周りのアップデート&セッションの共有/around-re-invent-2024-iac-updates
tomoki10
0
400
Classmethod_regrowth_2024_tokyo_security_identity_governance_summary
hiashisan
0
380
深層学習のリペア技術の最新動向と実際 / DNN Repair Techniques for AI Performance Alignment for Safety Requirements
ishikawafyu
0
480
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
40
7.1k
What's in a price? How to price your products and services
michaelherold
243
12k
Code Reviewing Like a Champion
maltzj
520
39k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
1
94
Writing Fast Ruby
sferik
627
61k
Docker and Python
trallard
41
3.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.2k
Six Lessons from altMBA
skipperchong
27
3.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
24k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
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