Applying oCPC algorithm for production

Ad6c3628aba9c357f42e412468e39732?s=47 yoppi
August 12, 2018

Applying oCPC algorithm for production

Ad6c3628aba9c357f42e412468e39732?s=128

yoppi

August 12, 2018
Tweet

Transcript

  1. OCPCΛຊ൪؀ڥʹద༻͢ Δ·Ͱ @YOPPIBLOG ADOKEN#1

  2. ࣗݾ঺հ IMPORT “GITHUB.COM/YOPPI" ▸ ٛా തҰ @yoppiblog ▸ Speee, Inc.

    Engineer ▸ ࠷ۙ͸ΞυςΫք۾ʹ͍ͯɺࠓ͸UZOUͷϨίϝϯυΤϯδ ϯͱ͔࡞͍ͬͯ·͢ ▸ Go͕޷͖
  3. OCPCΛຊ൪؀ڥʹద༻͢Δ·Ͱ ࠓ೔ͷ͓࿩ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞੒ ▸ γϛϡϨʔγϣϯʹΑΔݕূ

    ▸ ຊ൪؀ڥͰͷ࣮૷ ▸ A/BςετͰͷϞχλϦϯάͱ෼ੳ ▸ ݱঢ়ͷ՝୊ͱࠓޙͷํ਑
  4. OCPCΛຊ൪؀ڥʹద༻͢Δ·Ͱ ࠓ೔ͷ͓࿩ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞੒ ▸ γϛϡϨʔγϣϯʹΑΔݕূ

    ▸ ຊ൪؀ڥͰͷ࣮૷ ▸ A/BςετͰͷϞχλϦϯάͱ෼ੳ ▸ ݱঢ়ͷ՝୊ͱࠓޙͷํ਑
  5. OCPCʹ͍ͭͯ OCPC ▸ Optimize CPCͷݺশ ▸ ೖߘ͞Εͨ޿ࠂͷ໨ඪCPAͷୡ੒ͱ഑৴ֹۚͷ࠷େԽΛ໨ࢦͨ͢ΊʹࣗಈͰCPCೖ ࡳ͢Δػೳ ▸ جຊతʹCPA͕ѱԽ͢ΔͱͦͷΞυωοτϫʔΫͰͷ഑৴͕ࢭ·Δ

    ▸ CPAΛୡ੒ͤ͞Α͏ͱCPCΛखಈௐ੔΋Ͱ͖ͳ͘͸ͳ͍͕഑৴໘͕ଟྔͳͨΊਓख Ͱͷௐ੔͸ඇݱ࣮త ▸ ސ٬ͷຬ଍౓Λ޲্͢ΔͨΊʹ΋ϓϩμΫτͷ࣭ʢརӹʣΛ޲্͢ΔͨΊʹ΋ػೳͱ͠ ࣮ͯ૷͞Ε͍ͯΔ΂͖ ▸ ͱ͸͍͑໨ඪCPAΛݱ࣮ʹ͙ͦΘͳֹ͍ۚͰઃఆ͞Εͨ΋ͷΛͳΜͱ͔͢ΔػೳͰ ͸ͳ͍͜ͱ͸લఏ
  6. OCPCʹ͍ͭͯ OCPCΛ࣮૷͍ͯ͠Δڝ߹ଞࣾ ▸ جຊతʹCPAͷվળٴͼӡ༻޻਺ͷ࡟ݮͱ͍͏Ґஔ͚ͮͰ UZOU΋ͦ͜Λΰʔϧͱ͢Δͷ͸มΘΒͳ͍ ▸ Outbrain ▸ Logly ▸

    Smart News ▸ LINE Ads
  7. OCPCΛຊ൪؀ڥʹద༻͢Δ·Ͱ ࠓ೔ͷ͓࿩ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞੒ ▸ γϛϡϨʔγϣϯʹΑΔݕূ

    ▸ ຊ൪؀ڥͰͷ࣮૷ ▸ A/BςετͰͷϞχλϦϯάͱ෼ੳ ▸ ࠓޙͷ՝୊ͱ·ͱΊ
  8. ௐࠪ ௐࠪ ▸ طଘͷϓϩμΫτ΍࿦จͷௐࠪ ▸ ࿦จΛยͬ୺͔ΒಡΜͰ͍͘ ▸ “Optimal Real-Time Bidding

    for Display Advertising” ͸ ͔ͳΓے͕ྑ͍ํ๏ͰࠓճͷϞσϧͷϕʔεʹͳ͍ͬͯΔ ▸ http://wnzhang.net/papers/ortb-kdd.pdf
  9. ௐࠪ OPTIMAL REAL-TIME BIDDING FOR DISPLAY ADVERTISING ▸ ੍໿৚݅෇͖ඇઢܗ࠷దԽ໰୊Λద༻ͯ͠RTBΛղ͍͍ͯΔ ▸

    ొ৔ਓ෺ ▸ Winning RateʢeCPM͕͍͘ΒͳΒଞͷ޿ࠂʹউͬͯ໘ʹͰΔͷ͔ʣ ▸ ༧ଌCTRʢະདྷͷCTRʣ ▸ ༧ଌCVRʢະདྷͷCVRʣ ▸ ϥάϥϯδϡະఆ৐਺ʢϥάϥϯδϡະఆ৐਺๏Ͱղ͘ࡍʹ෇༩͞Ε ͑Δม਺ʣ
  10. OCPCΛຊ൪؀ڥʹద༻͢Δ·Ͱ ࠓ೔ͷ͓࿩ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞੒ ▸ γϛϡϨʔγϣϯʹΑΔݕূ

    ▸ ຊ൪؀ڥͰͷ࣮૷ ▸ A/BςετͰͷϞχλϦϯάͱ෼ੳ ▸ ݱঢ়ͷ՝୊ͱ·ͱΊ
  11. Ϟσϧͷ࡞੒ Ϟσϧ࡞੒ ▸ ੍໿෇͖ඇઢܗ࠷దԽ໰୊ͱͯ͠਺ཧϞσϧΛ࡞ͬͯղ͘ ▸ ໨తؔ਺ɺ੍໿৚݅Λઃఆ͠ɺ੍໿৚݅Λຬͨͭͭ͠໨ తؔ਺Λ࠷େԽ͢Δʢ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 ໨తؔ਺ ੍໿৚݅
  12. Ϟσϧͷ࡞੒ ੍໿෇͖ඇઢܗ࠷దԽ໰୊ ▸ ࠷దԽ໰୊ͷ͏ͪඇઢܗͳ΋ͷΛඇઢܗ࠷దԽ໰୊ͱݺ Ϳ ▸ ϥάϥϯδϡະఆ৐਺๏ͰύϥϝʔλΛٻΊΔ͜ͱͰۙࣅ ղΛಘΒΕΔ ▸ ࠓճ͸eCPMউ཰ϞσϧΛ

    ͱஔ͍͍ͯΔͷͰತؔ ਺ͱͳΓχϡʔτϯ๏Ͱϥάϥϯδϡະఆ৐਺ΛٻΊ͍ͯ Δ y = x x + l
  13. Ϟσϧͷ࡞੒ ECPMউ཰Ϟσϧ ▸ ͲͷeCPMͳΒ഑৴͞ΕΔʢΦʔΫγϣϯʹউͭʣͰ͋Ζ͏ Ϟσϧ ▸ ໨తؔ਺͕ತؔ਺ʹͳΔΑ͏ͳ୯७ͳඇઢܗؔ਺༻͍ͯ࠷খ ೋ৐๏Ͱ࡞੒ ▸ ತؔ਺͸ඍ෼ՄೳʹͳΓ࠷దԽܭࢉͰۃ஋ܭࢉʹ͓͍ͯ

    ߴ଎ʹऩଋͤ͞͞ΕΔχϡʔτϯ๏͕࢖͑ΔͨΊ
  14. Ϟσϧͷ࡞੒ 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
  15. OCPCΛຊ൪؀ڥʹద༻͢Δ·Ͱ ࠓ೔ͷ͓࿩ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞੒ ▸ γϛϡϨʔγϣϯʹΑΔݕূ

    ▸ ຊ൪؀ڥͰͷ࣮૷ ▸ A/BςετͰͷϞχλϦϯάͱ෼ੳ ▸ ࠓޙͷ՝୊ͱ·ͱΊ
  16. γϛϡϨʔγϣϯʹΑΔݕূ γϛϡϨʔγϣϯʹΑΔݕূ ▸ ࣮ࡍʹoCPCϞσϧΛ࡞੒ͯ͠ҎԼͷ߲໨Λݕূ͢ΔͨΊʹγ ϛϡϨʔγϣϯʹ͓͍ͯݕূ ▸ ໨ඪCPAΛୡ੒Ͱ͖Δ͔Ͳ͏͔ ▸ ࠓճͷҰ൪ղܾ͍ͨ͠໨త ▸

    ഑৴ֹۚΛ࠷େԽͰ͖Δ͔Ͳ͏͔ ▸ ໨ඪCPAΛୡ੒͍ͯͯ͠΋഑৴͞Εͳ͚Ε͹རӹʹͳΒ ͳ͍
  17. γϛϡϨʔγϣϯʹΑΔݕূ γϛϡϨʔγϣϯͷ࣮૷ ▸ γϛϡϨʔγϣϯϑϨʔϜϫʔΫ͸ಛʹ࠾༻ͤͣɺPythonͰ ϑϧεΫϥονͰ࣮૷ ▸ ࡞੒ͨ͠ϞσϧͰCPCΛೖࡳͯ͠ ▸ ֤छϨίϝϯυΞϧΰϦζϜͰ޿ࠂΛநબ͠഑৴ ▸

    Λ܁Γฦ͢୯७ͳ΋ͷ
  18. γϛϡϨʔγϣϯʹΑΔݕূ ࣗલ࣮૷ͷPROS/CONS ▸ PROS ▸ ಛʹϥΠϒϥϦΛ࢖Θͣʹ࡞ͬͨͷͰॊೈʹ࣮૷Ͱ͖ͨ ▸ ޿ࠂΛநબ͢Δ෦෼΍ͦͷޙͷclickͷൃੜΛ੍ޚ͢Δඞཁ͕͋Δͷ ͰUZOUͷγεςϜʹدΓఴͬͨ΋ͷΛ࡞ͬͨ΄͏͕ྑ͍΋ͷʹͳΔ ▸

    CONS ▸ ൚༻ԽͰ͖Δ΋ͷʹͳ͍ͬͯͳ͍ ▸ ࠓճͷoCPCʹಛԽͨ͠࡞Γʹͳ͍ͬͯΔͷͰଞͷϓϩδΣΫτͰ͸ ͦͷ··࢖͑ͳ͍
  19. ຊ൪؀ڥͰͷ࣮૷ ࣮૷؀ڥ ▸ γϛϡϨʔγϣϯͱಉ͘͡PythonͰ࣮૷ ▸ ϦΞϧλΠϜͰͷbid͸͓ͯ͠Βͣόονܗࣜ

  20. ຊ൪؀ڥͰͷ࣮૷ ͳΔ΂࣮͘ߦ࣌ؒΛ୹͘͢Δ޻෉ ▸ σʔλιʔε͔ΒͦΕͳΓͷσʔλΛऔಘ͢Δඞཁ͕͋Δ ▸ SQLΛ޻෉ͯ͠PythonଆͰͳΔ΂͘ܭࢉͤ͞ͳ͍Α͏ʹ ▸ ਺ཧϞσϧΛܭࢉ͢Δͱ͖͸NumPy.arrayͰߴ଎ʹܭࢉͰ͖ΔΑ͏ʹ ▸ ѻ͏σʔλ͕ଟ͍ͷͰຊདྷͳΒ͹O(mn)͸ڐ༰͢Δͱ͜ΖΛO(n)ʹ

    ͢ΔΑ͏ʹఆ਺߲ΛͳΔ΂͘ഉআ͢ΔΑ͏ʹ ▸ ͦ΋ͦ΋χϡʔτϯ๏Λ࠾༻͍ͯ͠ΔͷͰऩଋ͕ͱͯ΋ߴ଎ʢ͍ͩ ͍ͨ਺ճͷΠςϨʔγϣϯͰऩଋ͍ͯ͠Δʣ
  21. OCPCΛຊ൪؀ڥʹద༻͢Δ·Ͱ ࠓ೔ͷ͓࿩ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞੒ ▸ γϛϡϨʔγϣϯʹΑΔݕূ

    ▸ ຊ൪؀ڥͰͷ࣮૷ ▸ A/BςετͰͷϞχλϦϯάͱ෼ੳ ▸ ݱঢ়ͷ՝୊ͱ·ͱΊ
  22. A/BςετͰͷಈ͖ํ A/BςετͰͷϞχλϦϯάͱ෼ੳ ▸ A/BςετΛ։࢝ͯ͠ɺ͏·͍ͬͯ͘Δ޿ࠂओͱ͏·͍ͬ͘ ͍͔ͯͳ͍޿ࠂओ͕ൃੜ ▸ ΞϧΰϦζϜ͸ۜͷ஄ؙͰ͸ͳ͍ͷͰԿ͕Өڹ͍ͯ͠Δͷ ͔෼ੳ͢Δඞཁ͕͋Δʢ͔͜͜Β͕Ή͠Ζຊ൪ ▸ ϞχλϦϯά͸μογϡϘʔυΛ࡞Γ೔࣌Ͱ੒ՌΛ෼ੳ

    ▸ μογϡϘʔυҎ֎Ͱ΋adhoc(Jupyter Notebook)Ͱ΋෼ ੳ͍ͯ͠Δ
  23. A/BςετͰͷಈ͖ํ ϞχλϦϯάπʔϧ ▸ dashΛ࢖༻ ▸ Python੡ʢflaskͷ্ʹಠࣗͷϑϨʔϜϫʔΫΛ৐͍ͤͯ Δʣ ▸ SPAͰಈ͘ʢReactͷίϯϙʔωϯτΛPythonͰॻ͚Δʣ SSR

  24. OCPCΛຊ൪؀ڥʹద༻͢Δ·Ͱ ࠓ೔ͷ͓࿩ ▸ oCPCʹ͍ͭͯ ▸ ௐࠪ ▸ Ϟσϧͷ࡞੒ ▸ γϛϡϨʔγϣϯʹΑΔݕূ

    ▸ ຊ൪؀ڥͰͷ࣮૷ ▸ A/BςετͰͷϞχλϦϯάͱ෼ੳ ▸ ݱঢ়ͷ՝୊ͱࠓޙͷํ਑
  25. ݱঢ়ͷ՝୊ͱࠓޙͷํ਑ A/Bςετ݁Ռ ▸ ͏·͍͍ͬͯ͘Δ޿ࠂओ΋͍Ε͹ ▸ ໨ඪCPAΛୡ੒͍ͯͯ͠഑৴ֹۚ΋Ͱ͍ͯΔ ▸ ͏·͍͍ͬͯ͘ͳ͍޿ࠂओ΋͍Δ ▸ ໨ඪCPA͸ୡ੒͍ͯ͠Δ͕഑৴ֹ͕ۚग़͍ͯͳ͍΋ͷ͕ଟ

    ͍
  26. ݱঢ়ͷ՝୊ͱࠓޙͷํ਑ ͏·͍͍ͬͯ͘Δ΋ͷͱͦ͏Ͱͳ͍΋ͷΛ෼ੳ ▸ جຊతʹ͏·͍͍ͬͯ͘ͳ͍΋ͷ͸഑৴ྔ͕গͳ͍ ▸ ຊདྷ͋Δ΂͖ਅͷCPCʹಧ͔ͣෛ͚ͯ͠·ͬͯ഑৴͞Εͳ ͍ঢ়ଶ

  27. ݱঢ়ͷ՝୊ͱࠓޙͷํ਑ ਅͷCPCͱBID CPCͷൺֱ

  28. ݱঢ়ͷ՝୊ͱࠓޙͷํ਑ ਅͷCPCͱBID CPCͷൺֱ

  29. ݱঢ়ͷ՝୊ͱࠓޙͷํ਑ ਅͷCTRͱ༧ଌCTRͷ෼෍

  30. ݱঢ়ͷ՝୊ͱࠓޙͷํ਑ ਅͷCVRͱ༧ଌCVRɾ഑৴ֹׂۚ߹ͷ෼෍

  31. ݱঢ়ͷ՝୊ͱࠓޙͷํ਑ ECPMউ཰Ϟσϧͷਫ਼౓෼ੳ

  32. ݱঢ়ͷ՝୊ͱࠓޙͷํ਑ ϞσϧͷվળҊ ▸ ༧ଌCVRͱeCPMউ཰Ϟσϧ͕ѱͦ͏ͱݴ͑ΔͷͰ͜͜Λվળ͍ͯ͘͠ ▸ ༧ଌCVRͷࣄલ෼෍ͷվળ ▸ eCPMউ཰ϞσϧΛվળ ▸ StepModelͱConstantModelͷࠞ߹Ϟσϧ͸ΘΓͱྑͦ͞͏͕ͩ

    ತؔ਺Ͱͳ͘ͳΔͷͰχϡʔτϯ๏͕࢖͑͘ͳΓSGD౳ʹ੾Γସ ͑Δඞཁ͋Γ ▸ https://media.readthedocs.org/pdf/lmfit-py/0.9.3/lmfit-py.pdf
  33. ڊਓͷݞʹ৐Δ ͦͷଞͷࢀߟจݙ ▸ ࠷దԽ௒ೖ໳ 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