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
FukuokaR #7
Search
Hiroki Mizukami
March 25, 2017
Science
0
320
FukuokaR #7
https://www.amazon.co.jp/dp/4774188778
Hiroki Mizukami
March 25, 2017
Tweet
Share
More Decks by Hiroki Mizukami
See All by Hiroki Mizukami
音楽配信サービスにおける 推薦システムの概要と 数理モデルについて
hiroki_mizukami
0
200
CADEDA #6 AWAにおけるデータ利活用の取り組みと今後の展望について
hiroki_mizukami
4
2.2k
オンライン広告の数理モデルと数学ソフトウェア MSFD#23
hiroki_mizukami
6
4.5k
Other Decks in Science
See All in Science
20240420 Global Azure 2024 | Azure Migrate でデータセンターのサーバーを評価&移行してみる
olivia_0707
2
930
AI科学の何が“哲学”の問題になるのか ~問いマッピングの試み~
rmaruy
1
2.3k
Mechanistic Interpretability の紹介
sohtakahashi
0
410
Cross-Media Information Spaces and Architectures (CISA)
signer
PRO
3
30k
ベイズのはなし
techmathproject
0
340
ほたるのひかり/RayTracingCamp10
kugimasa
0
410
ベイズ最適化をゼロから
brainpadpr
2
900
Science of Scienceおよび科学計量学に関する研究論文の俯瞰可視化_ポスター版
hayataka88
0
150
創薬における機械学習技術について
kanojikajino
13
4.7k
【人工衛星開発】能見研究室紹介動画
02hattori11sat03
0
160
拡散モデルの原理紹介
brainpadpr
3
5.2k
Spectral Sparsification of Hypergraphs
tasusu
0
190
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Side Projects
sachag
452
42k
Building Your Own Lightsaber
phodgson
103
6.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
GraphQLとの向き合い方2022年版
quramy
44
13k
A Philosophy of Restraint
colly
203
16k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Transcript
Ӣ Ӣ Ӣ Ӣ Ӣ Ӣ Ӣ Ӣ Ӣ Ӣ
Ӣ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ొ ཽ
ཽ ܭ ౷ ొ ཧ ֬ 2
ཧϞσϦϯάͱɺ ౷ܭϞσϦϯάͱɺ ͦΕ͔Βɺࢲɻ 2
ཽ ܭ ౷ ొ ཧ ֬ 3
@ Fukuoka R Mar 25, 2017 य़ Hiroki Mizukami Destroy 3
ཽ ܭ ౷ ొ ཧ ֬ 4
※ݸਓͷݟղɻɻɻ 4
ཽ ܭ ౷ ొ ཧ ֬ 5
5 ࣗݾհͱ͝ΊΜͳ͍͞ ౷ܭϞσϦϯά ༧ଌͱ൚Խ ઢܗճؼϞσϧ ·ͱΊ ཧϞσϦϯά ղऍͱ൚Խ
• Έ͔ͣΈ ͻΖ͖ • LINE_ID: @piroyoung • αΠόʔܥͷAI Labɽ •
αʔόαΠυΤϯδχΞ • σʔλαΠΤϯςΟετ • ౦ژࡏॅʗԬग़ • ֶʗࠂʗWeb • Love έΰύʔΫ • R/Python/Scala/javascript/Spark/ Docker/AWS/Stan/Tableau/AWS/GCP ࣗݾհ ϔϏϝλ
Rݴޠ ʢڱٛʣ Rݴޠʢ͋ʔΔ͛Μ͝ʣΦʔϓϯιʔεɾϑϦʔιϑτΣΞͷ౷ܭղੳ͚ ͷϓϩάϥϛϯάݴޠٴͼͦͷ։ൃ࣮ߦڥͰ͋Δɻ RݴޠχϡʔδʔϥϯυͷΦʔΫϥϯυେֶͷRoss IhakaͱRobert Clifford GentlemanʹΑΓ࡞ΒΕͨɻݱࡏͰR Development Core
TeamʢSݴޠ։ൃऀ Ͱ͋ΔJohn M. Chambersࢀը͍ͯ͠Δ[1]ɻʣʹΑΓϝϯςφϯεͱ֦ு͕ͳ ͞Ε͍ͯΔɻ RݴޠͷιʔείʔυओʹCݴޠɺFORTRANɺͦͯ͠RʹΑͬͯ։ൃ͞Εͨɻ - wikipedia -
Rݴޠ ʢٛʣ σʔλੳΛੜۀͱ͢Δܑ͓͞Μ͓Ͷ͐͞ΜୡͷίϛϡχςΟͷ૯শɾ֓೦ɾε ϥϯάɻདྷΔͷશͯڋ·ͳ͍ελΠϧͰɺ࣮ࡍʹσʔλੳΛ͍ͬͯΔ͔ ͢ΒجຊతʹࣗݾਃࠂɻϢʔϞΞͱϢʔϞΞͱਓฑ͕ΛूΊΔϙΠϯτɽෳ ͷελʔτΞοϓϕϯνϟʔΛੜΈग़͍ͯ͠Δɽ ͱ͋Δ౷ܭʹΑΔͱ࣮ࡍʹRΛ͔ͭͬͯΔͻͱ Α͏͢ΔʹɼࠓRͷίΞͳ͠ͳ͍ͬͯ͜ͱͰ͢͢Έ·ͤΜɽ - mikipedia
-
ཽ ܭ ౷ ొ ཧ ֬ 9
9 ࣗݾհͱ͝ΊΜͳ͍͞ ౷ܭϞσϦϯά ༧ଌͱ൚Խ ઢܗճؼϞσϧ ·ͱΊ ཧϞσϦϯά ղऍͱ൚Խ
ཧϞσϦϯά ཧϞσϦϯά ͱσʔλͷதʹ͋ΔߏΛࣜͰهड़͢Δ͜ͱ ྫ͑͜Μͳσʔλ͕༗Δ ͜ͷͱ͖όωAʹؔͯ͠ ʦόωͷ͞ʧʹ 0.2 x [͓Γͷॏ͞] +
3 ͱݱʹؔ͢Δࣜͷදݱ͕ಘΒΕΔɽ
ཧϞσϦϯά Ͳ͏ͬͨʁ όωAʹؔͯ͠ҎԼͷ࿈ཱํఔ͕ࣜͨͯΒΕΔ ͜ΕΛղ͚
ཧϞσϦϯά Կ͕͏Ε͍͠ʁ • ݱ࣮ͷͷߟʹֶͷςΫχοΫͰ͑ΒΕΔɽ • ײ͕ٴͳ͍ʹ͑Δ • ݫີ • ఆྔత
• ʮόωAͷํ͕৳ͼ͍͢ʯ
ཧϞσϦϯά ݫີʻʼײɼఆྔతʻʼఆੑత ʮؾԹ͕ߴ͍ͱδϝδϝ͢ΔͶ͐ʯ ͜Ε͜ΕͰॏཁɽ
ཽ ܭ ౷ ొ ཧ ֬ 14
ʮͱΓ͋͑ͣɺՄࢹԽ͠Αʁʯ 14
ཽ ܭ ౷ ొ ཧ ֬ 15
ʮࣜɺͨͯΐʁʯ 15
ཽ ܭ ౷ ొ ཧ ֬ 16
ʮσʔλΛೖ͠Αʁʯ 16
ཽ ܭ ౷ ొ ཧ ֬ 17
ʮύϥϝλܭࢉͰ͖ͨ͊ʂʂʯ 17
ཽ ܭ ౷ ొ ཧ ֬ 18
18 Click = CTR · Imp
ཽ ܭ ౷ ొ ཧ ֬ 19
19 pV = nRT
ཽ ܭ ౷ ొ ཧ ֬ 20
20
ཽ ܭ ౷ ొ ཧ ֬ 21
21 ࣗݾհͱ͝ΊΜͳ͍͞ ౷ܭϞσϦϯά ༧ଌͱ൚Խ ઢܗճؼϞσϧ ·ͱΊ ཧϞσϦϯά ղऍͱ൚Խ
౷ܭϞσϦϯά ౷ܭϞσϦϯά ͱ֬ʹجͮ͘ཧϞσϦϯάɽ ֬มΛؚΉϞσϧࣜΛ༻͍Δɽ ֬มͱϥϯμϜͳৼΔ͍ʹ؍ଌΛରԠ͚ΔΈͷ͜ͱɽ ཁ͢Δʹ ʮ ͕ग़ͨ−ʂʂʯʹʼ 1 ͬͯͳ۩߹ɽ
X : ! 2 ⌦ 7! X(!) 2 R
౷ܭϞσϦϯά ࣄͱߟͷରͱ͢ΔϥϯμϜͳৼΔ͍ͷ͋ͭ·Γɽ ͜Ε؍ଌ͕͇ΛԼճΔͱ͍͏ৼΔ͍ͷू·Γͷ͜ͱ ֶతͳఆٛ X : ! 2 ⌦ 7!
X(!) 2 R X < x [ X < x ] := X 1([ 1 , x )) = { ! 2 ⌦| X ( ! ) < x }
౷ܭϞσϦϯά ֬ͱ؍ଌͷཚࡶ͞ͷֶతදݱ ͜Εਖ਼نͰ͜Μͳײ͡ʹද͢ɽ ʮ֬มX͕ฏۉμɼඪ४ภࠩσͷਖ਼نʹै͏ʯͱಡΉɽ μσͳͲͷΛݸੑ͚ΔύϥϝλΛ ͱ͍͏ɽ X ⇠ N(µ,
2)
౷ܭϞσϦϯά ਪఆͱɼσʔλΛͱʹΛ༧͢Δ͜ͱ ʮΉΉʔʂ͜Ε֬0.5Ͱද͕ग़Δͷ͔͠Εͳ͍ʂʯ ʮͬͺ10ͷ1͘Β͍͔͠Εͳ͍ɽɽɽʯ ͜ͷਪఆͷʢͬͱʣΒ͠͞ͱݺΕ͍ͯΔ ද ཪ ද ཪ ཪ
ཪ ཪ ཪ ཪ ཪ ཪ ཪ
ཽ ܭ ౷ ొ ཧ ֬ 26
26 ࣗݾհͱ͝ΊΜͳ͍͞ ౷ܭϞσϦϯά ༧ଌͱ൚Խ ઢܗճؼϞσϧ ·ͱΊ ཧϞσϦϯά ղऍͱ൚Խ
ઢܗճؼϞσϧ ҎԼͷΑ͏ͳσʔλ͕༗Δɽ ͕ɼ࣮෩͕ਧ͍ͯͯਖ਼֬ʹܭଌग़དྷͯͳ͍ͬΆ͍ɽ ࠷ॳͱ͓ͳ͡ઢܗͷϞσϧࣜʹσʔλΛೖͯ͠ΈΔͱ
ઢܗճؼϞσϧ
ཽ ܭ ౷ ొ ཧ ֬ 29
ղ͚ͳ͌ɻɻɻ 29
ཽ ܭ ౷ ొ ཧ ֬ 30
ղͷͳ͌ɺ࿈ཱํఔࣜɻɻɻ 30
ཽ ܭ ౷ ొ ཧ ֬ 31
୳ͯ͠ɺݟ͔ͭΒͳ͌ͬͯίτɻɻɻ 31
ཽ ܭ ౷ ొ ཧ ֬ 32
͏ŵŧƄແཧɻ౷ܭ͠ΐɻɻɻ 32
ઢܗճؼϞσϧ ͜ͷϞσϧ؍ଌޡ͕ࠩߟྀ͞Ε͍ͯͳ͌ɻɻɻ ਖ਼نͷޡࠩԾఆ͢Δ y = ✓0 + ✓1x +✏ y
= ✓0 + ✓1x ✏ ⇠ N(0, 2)
ઢܗճؼϞσϧ ਖ਼نʹै͏ޡࠩΛԾఆͨ͠ϞσϧΛઢܗճؼϞσϧͱ͍͏ ✏ ⇠ N(0, 2) Y (✓0 + ✓1X)
⇠ N(0, 2) Y ⇠ N(✓0 + ✓1X, 2)
ཽ ܭ ౷ ొ ཧ ֬ 35
ਪఆ͠ΐɻɻɻ 35
ઢܗճؼϞσϧ ਖ਼نʹै͏ޡࠩΛԾఆͨ͠ϞσϧΛઢܗճؼϞσϧͱ͍͏ Ұ൪Β͍͠θͱσΛܭࢉ͢Δ ͜͜Ͱ Y ⇠ N(✓0 + ✓1X, 2)
L(✓1, ✓2, ) = Y i 1 p 2⇡ 2 e (yi µi)2 2 2 µi = ✓0 + ✓1xi
ઢܗճؼϞσϧ ରؔ θͷਪఆԼઢ෦Λ࠷খʹ͢Ε͍͍ࣄ͕Θ͔Δ ͜ΕΛ࠷খ2๏ͱ͍͏ɽ = 0
ઢܗճؼϞσϧ σʹؔ͢Δํఔࣜ ͜ΕΛղ͚ ͕ಘΒΕΔɽ͜Εඪຊࢄɽ @ @ log L ( ✓1,
✓2, ) = 0 2 = 1 n X i (yi µi)2
ઢܗճؼϞσϧ Rͩͱ؆୯ʹܭࢉͰ͖Δɽ
ཽ ܭ ౷ ొ ཧ ֬ 40
PythonͩͬͨΒɻɻɻ statsmodels / sklearn.linear_model.*** 40
ཽ ܭ ౷ ొ ཧ ֬ 41
41 ࣗݾհͱ͝ΊΜͳ͍͞ ౷ܭϞσϦϯά ղऍͱ൚Խ ઢܗճؼϞσϧ ·ͱΊ ཧϞσϦϯά
ઢܗճؼϞσϧ ղऍλεΫ ؍ଌ͞Εͨσʔλͷੑ࣭ΛௐΔɽ ੑผ༧ଌϞσϧ αΠτAΛݟͯΔͷஉੑ͕ଟ͍ɽ
ઢܗճؼϞσϧ ղऍλεΫ ͜ͷCPAʢ͋ͨΓίετʣࢪࡦͷྑ͞ͷධՁͱͯ͠༗ޮ Ͱɽɽɽ ʮ2ஹԁग़ͨ͠ΔΘ ɼ2ԯCVΖʯʹʼ͑ͬɾɾɾ ͪΖΜແཧ͕͋Δ CV = 1
CPA · Cost
ઢܗճؼϞσϧ ղऍλεΫ ͜ͷCPAʢ͋ͨΓίετʣࢪࡦͷྑ͞ͷධՁͱͯ͠༗ޮ Ͱɽɽɽ ʮ2ஹग़ͨ͠ΔΘʯ ʹʼ 2ԯCVʁʁʁ ͪΖΜແཧ͕͋Δ CV =
1 CPA · Cost y=x/CPA
ઢܗճؼϞσϧ ൚ԽλεΫ ະͷσʔλʹର͢Δ༧ଌੑೳࢸ্ओٛ • Neural Network • Gradient Boosting Decision
Tree • SVM with some kernel • Ridge/Lasso • Feature Hashing ౷ܭతͳͷΈͰಈ͍͍ͯͳ͍͕ଟ͍ Α͘Θ͔ΒΜ͕Կނ͔ͨΔ
ઢܗճؼϞσϧ ൚ԽλεΫ minimize: loss(label, Feature) Feature Label
ཽ ܭ ౷ ొ ཧ ֬ 47
47 ࣗݾհͱ͝ΊΜͳ͍͞ ౷ܭϞσϦϯά ղऍͱ൚Խ ઢܗճؼϞσϧ ·ͱΊ ཧϞσϦϯά
• ཧϞσϦϯάΛ༻͍Εݱ࣮ͷΛֶͷϊ ϋͰղܾͰ͖Δ • ౷ܭతͳςΫχοΫΛ͏͜ͱͰߋʹॊೈʹ • ൚ԽͱղऍϞσϧผͷςΫχοΫ ·ͱΊ
ੈా୩۠ࡏॅ H.M͞Μ ʮ࠷ॳʰ͜Μͳॻ੶Ͱඞཁͳ͕ࣝΈʹͭ͘ͳΜͯɾɾɾʱͱ͍͏ؾ࣋ͪ ͋Γɺ৴ٙͰ͜ͷຊΛखʹऔΓ·ͨ͠ɻ͍͟खʹͱͬͯݟΔͱShell ScriptSQLͷجૅͪΖΜɼPythonʹΑΔ࣮ફతͳΞϓϦέʔγϣϯͷ ࡞Γํ·Ͱஸೡʹղઆ͞Ε͍ͯͯ༧Ҏ্ͷϘϦϡʔϜͰͨ͠ɻͱ͘ʹۤख ͩͬͨ౷ܭϞσϦϯάטΈࡅ͍ͯॻ͔Ε͍ͯͯऔֻ͔ͬΓʹ࠷ߴͩͬͨ ͱࢥ͍·͢ɻ2000ԁऑͱ͍͏Ձֶ֨ੜʹخ͍͠Ͱ͢ɻࠓͰຖ൴ঁͱ ͤʹΒͯ͠ډ·͢ɻʯ ͨͳ͠ΎΜύΫͬͨ͝ΊΜ