Share
Embed
CFML関連のライブラリの紹介 / cfml #3 libraries
CFML勉強会#3の資料です。( https://cfml.connpass.com/event/150818/ )
Kazuki Taniguchi
October 30, 2019
Transcript
32 slides
-
• ৬ྺ • 2014.4-2019.3 • גࣜձࣾαΠόʔΤʔδΣϯτΞυςΫຊ෦ AI Lab Research Scientist
/ MLΤϯδχΞ / Data Scientist • 2019.4- • ITܥϕϯνϟʔ (ϓϩμΫτ։ൃ/ϚʔέςΟϯά) • ϑϦʔϥϯε (AI/MLͷݚڀ։ൃ) • ݚڀ • Pattern Recognition / Image Restoration • Recommendation / Response Prediction • Counterfactual Machine Learning ࣗݾհ ୩ޱ ً (@kazk1018) -
ࠓճհ͢ΔϥΠϒϥϦ • DoWhy (Microsoft) • EconML (Microsoft) • CausalML (Uber)
• Vowpal Wabbit (OSS) -
ࠓճհ͢ΔϥΠϒϥϦ • DoWhy (Microsoft) • EconML (Microsoft) • CausalML (Uber)
• Vowpal Wabbit (OSS) Causal Inference (uplift modeling) Contextual Bandit (ML) -
• ઃఆ • ؍ଌ͞ΕΔoutcome࣍ͷΑ͏ʹදͤΔ Causal Inference : ಛϕΫτϧ xi ∈
X : հೖͷׂ Ti ∈ T = {0,1} : potential outcome Y(T) i ∈ ℝ Yi = Ti Y(1) i + (1 − Ti )Y(1) i -
Treatment Effects • Average Treatment Effect (ATE) • Conditional Average
Treatment Effect (CATE) τ = [Y(1) − Y(0)] τ(x) = [Y(1) − Y(0) |X = x] -
Ͳ͏͍͏໘Ͱར༻͞ΕΔͷ͔ • Personalized Pricing • త • ׂҾՁ֨ͰΦϑΝʔ͢Δ͜ͱͰߪೖଅਐΛߦ͏ • ׂҾߪೖ͕૿͑Δ͜ͱͰ࠾ࢉΛ߹Θ͍ͤͨ
Treatment: Outcome: ΦϑΝʔΛग़͔͢Ͳ͏͔ ߪೖ͢Δ͔Ͳ͏͔ ઃఆ ׂҾՁ֨ʹΑΔࢪࡦͷҼՌޮՌΛݟ͍ͨ -
Ͳ͏͍͏໘Ͱར༻͞ΕΔͷ͔ • Personalized Pricing ͜ͷࢪࡦશମΛ௨ͯ͠ ͲΕ͘Β͍ͷޮՌ͕͋ΔΜͩΖ͏͔ ͜ͷࢪࡦ୭ʹରͯ͠ ͲΕ͘Β͍ͷޮՌ͕͋ΔΜͩΖ͏͔ → ATE
→ CATE ҼՌޮՌΛΔ͜ͱͰࢪࡦͷޮՌΛଌΕΔ -
DoWhy • Microsoft͕։ൃͨ͠PythonͷҼՌਪͷϥΠϒϥϦ • ҼՌਪʹ͓͚ΔԾఆΛνΣοΫ͠ͳ͕Β࠷ऴతʹਪఆ·ͰΛ ߦ͏ (backdoor, IV) • άϥϑ(DAG)ΛࣗΒೖྗ͢Δඞཁ͕͋Δ
• ҼՌਪΛॳΊֶͯͿਓ͕ؒखΛಈ͔͠ͳ͕Βֶश͢Δͷʹ࠷ దͳϥΠϒϥϦͱ͍͏ҹ -
EconMLͱCausalMLͷҧ͍ EconML CausalML estimator.fit(Y, T, X, W) estimator.estimate_ate(Y, T, X)
Y: Outcome T: Treatment X: Features W: Controls Y: Outcome T: Treatment X: Features EconMLCATEʹ͓͚ΔConditionͱͳΔX(Features)ͱ ͦΕҎ֎ͷಛ(Controls)Λ͚ΔԾఆΛஔ͍͍ͯΔ -
Algorithms DoWhy EconML CausalML Basic Algorithms (Matching, IV, RD) ̋
Deep IV [1] ̋ Double Machine Learning [2] ̋ Orthogonal Random Forests [3] ̋ Meta-Learners [4] ̋ ̋ Uplift Tree [5] ̋ -
Contextual Bandit • ઃఆ • ΞʔϜΛબ͢ΔํࡦΛ࣍ͷΑ͏ʹఆٛ͢Δ : ಛϕΫτϧ xt ∈
X : ʹબͨ͠ΞʔϜ at t ∈ A = {a1 , . . , aK } : ΛબΜͰಘΒΕΔใु rat at ∈ ℝ at ∼ π(xt ) -
Contextual Bandit • ࠷దͳarmΛબͼଓ͚ΔํࡦΛ ͱ͢ΔͱɺRegret࣍ͷ Α͏ʹදͤΔ • RegretΛ࠷খʹ͢ΔํࡦΛݟ͚͍ͭͨ π*(x) R(π,
T) = [ T ∑ t=1 rt,a*] − [ T ∑ t=1 rt,π(x)] -
Approaches • Inverse Propensity Score [6] • Doubly Robust Estimator
[7] • Direct Method • ୯७ͳใुʹؔ͢Δճؼ (biased) • Multi Task Regression[8] -
Input File Format ςΩετ ಛϕΫτϧ ΞΫγϣϯ ίετ ֬ cBD <
> cCE < > cBCD \B C D^ cBC cBCD \B C^ \B C D^ ແࢹ • ೖྗϑΥʔϚοτͱಛͷྫ ※(adfͷͱ͖) ෳߦͰΞʔϜΛදݱɺબ͞ΕͨΞʔϜʹίετͱ֬Λهड़͢Δ ※ -
Summary • ҼՌਪͷϥΠϒϥϦͷհ • ͜Ε͔ΒҼՌਪΛֶ΅͏ͱ͢Δਓ • DoWhy • ͜Ε͔Β؍ଌσʔλΛ༻͍ͯҼՌޮՌΛਪఆ͍ͨ͠ਓ •
EconML / CausalML • Contextual BanditͷϥΠϒϥϦͷհ • Vowpal Wabbit -
Reference 1. Jason Hartford, Greg Lewis, Kevin Leyton-Brown, and Matt
Taddy, "Deep IV: A flexible approach for counterfactual prediction”, Proceedings of the 34th International Conference on Machine Learning, 2017. 2. Chernozhukov, Victor, Denis Chetverikov, Mert Demirer, Esther Duflo, Christian Hansen, Whitney Newey, and James Robins, “Double/Debiased Machine Learning for Treatment and Structural Parameters”, Econometrics Journal, 21, pp.C1–C68. 3. M. Oprescu, V. Syrgkanis and Z. S. Wu, "Orthogonal Random Forest for Causal Inference”, Proceedings of the 36th International Conference on Machine Learning (ICML), 2019. 4. Sören R Künzel, Jasjeet S Sekhon, Peter J Bickel, and Bin Yu, "Meta-learners for estimating heterogeneous treatment effects using machine learning”, arXiv preprint arXiv:1706.03461, 2017. 5. Piotr Rzepakowski and Szymon Jaroszewicz, "Decision trees for uplift modeling with single and multiple treatments”, Knowl. Inf. Syst., 32(2):303–327, August 2012. 6. Horvitz, D. G., & Thompson, D. J., “A Generalization of Sampling Without Replacement from a Finite Universe”, Journal of the American Statistical Association, 47(260), 663–685 7. Dudı́k Miroslav, Langford, J., & Li, L., “Doubly Robust Policy Evaluation and Learning”, In Proceedings of the 28th International Conference on Machine Learning, Bellevue, 2011 (pp. 1097–1104) 8. Karampatziakis, N., & Langford, J.,”Online Importance Weight Aware Updates”, In Proceedings of the Twenty- Seventh Conference on Uncertainty in Artificial Intelligence (pp. 392–399) -
Reference • DoWhy • DoWhy (https://microsoft.github.io/dowhy/index.html) • ౷ܭతҼՌਪͷͨΊͷPythonϥΠϒϥϦDoWhyʹ͍ͭͯղઆɿͳʹ͕Ͱ͖ͯɺͳʹʹҙ͖͢ (https://www.krsk-phs.com/entry/2018/08/22/060844) •
EconML • EconML (https://github.com/microsoft/EconML) • EconMLύοέʔδͷհ (meta-learnersฤ) (https://usaito.hatenablog.com/entry/2019/04/07/205756) • CausalML • CausalML (https://github.com/uber/causalml) • Vowpal Wabbit • Vowpal Wabbit (https://vowpalwabbit.org/index.html)