機械学習の社会実装では、予測精度が高くても、機械学習がブラックボックであるために使うことができないということがよく起きます。
このスライドでは機械学習が不得意な予測結果の根拠を示すために考案されたLIMEの論文を解説します。
Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should i trust you?" Explaining the predictions of any classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016.
データマイニングや機械学習をやるときによく問題となる「リーケージ」を防ぐ方法について論じた論文「Leakage in Data Mining: Formulation, Detecting, and Avoidance」(Kaufman, Shachar, et al., ACM Transactions on Knowledge Discovery from Data (TKDD) 6.4 (2012): 1-21.)を解説します。
主な内容は以下のとおりです。
・過去に起きたリーケージの事例の紹介
・リーケージを防ぐための2つの考え方
・リーケージの発見
・リーケージの修正
Towards Knowledge-Based Personalized Product Description Generation in E-comm...harmonylab
出典:Qibin Chen, Junyang Lin, Yichang Zhang, Hongxia Yang, Jingren Zhou, Jie Tang : Towards Knowledge-Based Personalized Product Description Generation in E-commerce, Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD2019), Anchorage, Alaska, USA, (2019)
公開URL:https://arxiv.org/abs/1903.12457
概要:ECサイトにおける商品説明文の自動生成に関する論文です。商品タイトルから商品説明文を生成するEncoder-Decoderモデル(Base lineモデル)を考えます。このBase lineモデルによって生成される文章は一般的で曖昧な記述をすることが多くあまり使い物にならないとされています。商品説明文に必要な要素は次の2点であると本論文では主張しています。1.顧客の興味を促進するために、商品説明文は顧客の好みに基づいてパーソナライズされる必要があるとされています。2.顧客の意思決定に役立つ説明文には、商品の関連知識が含まれている必要があります。本論文では、パーソナライズされた情報量の多い説明文を生成するために、ユーザカテゴリや外部の知識ベースから取得してきた知識に基づいて商品紹介文を生成するKnowledge Based Personalizedモデルを提案します。
データマイニングや機械学習をやるときによく問題となる「リーケージ」を防ぐ方法について論じた論文「Leakage in Data Mining: Formulation, Detecting, and Avoidance」(Kaufman, Shachar, et al., ACM Transactions on Knowledge Discovery from Data (TKDD) 6.4 (2012): 1-21.)を解説します。
主な内容は以下のとおりです。
・過去に起きたリーケージの事例の紹介
・リーケージを防ぐための2つの考え方
・リーケージの発見
・リーケージの修正
Towards Knowledge-Based Personalized Product Description Generation in E-comm...harmonylab
出典:Qibin Chen, Junyang Lin, Yichang Zhang, Hongxia Yang, Jingren Zhou, Jie Tang : Towards Knowledge-Based Personalized Product Description Generation in E-commerce, Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD2019), Anchorage, Alaska, USA, (2019)
公開URL:https://arxiv.org/abs/1903.12457
概要:ECサイトにおける商品説明文の自動生成に関する論文です。商品タイトルから商品説明文を生成するEncoder-Decoderモデル(Base lineモデル)を考えます。このBase lineモデルによって生成される文章は一般的で曖昧な記述をすることが多くあまり使い物にならないとされています。商品説明文に必要な要素は次の2点であると本論文では主張しています。1.顧客の興味を促進するために、商品説明文は顧客の好みに基づいてパーソナライズされる必要があるとされています。2.顧客の意思決定に役立つ説明文には、商品の関連知識が含まれている必要があります。本論文では、パーソナライズされた情報量の多い説明文を生成するために、ユーザカテゴリや外部の知識ベースから取得してきた知識に基づいて商品紹介文を生成するKnowledge Based Personalizedモデルを提案します。
KCS AI班2017年2月22日の活動。
“Why Should I Trust You?” Explaining the Predictions of Any Classifier (Ribeiro et al., 2016)の紹介。
機械学習のモデルの解釈可能な根拠を提示する手法「LIME」の論文。
How to generate PowerPoint slides Non-manually using RSatoshi Kato
Introduction to:
- Basic idea and procedure of {officer} package
- Getting started: Embedding texts, tables and figures in slides
- PowerPoint Structure: Layouts and Placeholders
- Making a template for specific layouts
- Making a template for your own slide-layouts
Resources are avail at: https://github.com/katokohaku/powerpoint_with_officer
Exploratory data analysis using xgboost package in RSatoshi Kato
Explain HOW-TO procedure exploratory data analysis using xgboost (EDAXGB), such as feature importance, sensitivity analysis, feature contribution and feature interaction. It is just based on using built-in predict() function in R package.
All of the sample codes are available at: https://github.com/katokohaku/EDAxgboost
a Japanese introduction of an R package {featuretweakR }
available from: https://github.com/katokohaku/featureTweakR
reference: "Interpretable Predictions of Tree-based Ensembles via Actionable Feature Tweaking" (https://arxiv.org/abs/1706.06691). Codes are at my Github (https://github.com/katokohaku/feature_tweaking)
Outline of Genetic Algorithm + Searching for Maximum Value of Function and Traveling Salesman Problem using R.
To view source codes and animation:
Searching for Maximum Value of Function
- https://github.com/katokohaku/evolutional_comptutation/blob/master/chap2.1.Rmd
Traveling Salesman Problem
- https://github.com/katokohaku/evolutional_comptutation/blob/master/chap2.2.Rmd
Intoroduction & R implementation of "Interpretable predictions of tree-based ...Satoshi Kato
a Japanese introduction and an R implementation of "Interpretable Predictions of Tree-based Ensembles via Actionable Feature Tweaking" (https://arxiv.org/abs/1706.06691). Codes are at my Github (https://github.com/katokohaku/feature_tweaking)
Introduction of "the alternate features search" using RSatoshi Kato
Introduction of the alternate features search using R, proposed in the paper. S. Hara, T. Maehara, Finding Alternate Features in Lasso, 1611.05940, 2016.
Introduction of sensitivity analysis for randamforest regression, binary classification and multi-class classification of random forest using {forestFloor} package
Imputation of Missing Values using Random ForestSatoshi Kato
missForest packageの紹介
“MissForest - nonparametric missing value imputation for mixed-type data (DJ Stekhoven, P Bühlmann (2011), Bioinformatics 28 (1), 112-118)
4. 人にやさしく
• 2.6 Human-friendly Explanations は、是非原著を!
• https://christophm.github.io/interpretable-ml-book/explanation.html
• 2.6.1 What Is an Explanation?
• 2.6.2 What Is a Good Explanation?
• 約2,200 words..ガンバレ!
最近、本を読みました
5. Explain! Explain! Explain!
The Daleks are a fictional extraterrestrial race portrayed in the Doctor Who BBC
series. Rather dim aliens, known to repeat the phrase Explain! very often. Daleks
were engineered. They consist of live bodies closed in tank-like robotic shells. They
seem like nice mascots for explanations concerning Machine Learning models.
https://pbiecek.github.io/DALEX_docs/
最近、本を読みました
15. the alternate features search
• Lasso変数選択の際の見落としの問題に対する提案
• 代替可能なモデル(変数候補)を提示する
• 予測はほとんど変わらないが、納得感のある別の説明を得られる可能性
S. Hara, T. Maehara, Finding Alternate Features in Lasso, arXiv:1611.05940, 2016.
https://github.com/sato9hara/LassoVariants
https://github.com/katokohaku/AlternateLassoR
(参考)Rashomon Effectの観点から
元の
変数
置換
候補
16. Taxonomy of Interpretability Methods
Intrinsic
• モデルの複雑性を制約することで、モデルそのものが解釈可能
Post hoc
• データからモデルを学習した後で説明手法を適用する
103. LIME
policy method name iml DALEX
residuals and goodness of fit ✘ ✔
permutation importance ✔ ✔
global surrogate Tree surrogate ✘
Merging Path Plot
(PDP for categorical data)
✘ ✔
Partial Dependence Plot
(PDP for continuous data) ✔ ✔
Individual Conditional Expectation (ICE) ✔ Ceteris Paribus Plots
Accumulated Local Effects (ALE) Plot ✔ ✔
Feature Interaction ✔ ✘
LIME ✔ ✘
SHAPLY value ✔ ✘
breakDown ✘ ✔
local interpretation
(for single prediction)
understand feature(s)
understand entire model
104. LIME(Locally Interpretable Model-agnostic Explanations)
• 説明したい観察の周辺で、単純な線形モデルによる近似を行う
• 近似モデルの重みが、各変数の予測に対する説明を表す
https://arxiv.org/abs/1602.04938
"Why Should I Trust You?"
105. 推定ステップ
• The general approach lime takes to achieving this goal is as follows:
1. For each prediction to explain, permute the observation n times.
2. Let the complex model predict the outcome of all permuted
observations.
3. Calculate the distance from all permutations to the original
observation.
4. Convert the distance to a similarity score.
5. Select m features best describing the complex model outcome from
the permuted data.
6. Fit a simple model to the permuted data, explaining the complex
model outcome with the m features from the permuted data
weighted by its similarity to the original observation.
7. Extract the feature weights from the simple model and use these
as explanations for the complex models local behavior..
https://cran.r-project.org/web/packages/lime/vignettes/Understanding_lime.html
LIME
128. breakDown
policy method name iml DALEX
residuals and goodness of fit ✘ ✔
permutation importance ✔ ✔
global surrogate Tree surrogate ✘
Merging Path Plot
(PDP for categorical data)
✘ ✔
Partial Dependence Plot
(PDP for continuous data) ✔ ✔
Individual Conditional Expectation (ICE) ✔ Ceteris Paribus Plots
Accumulated Local Effects (ALE) Plot ✔ ✔
Feature Interaction ✔ ✘
LIME ✔ ✘
SHAPLY value ✔ ✘
breakDown ✘ ✔
local interpretation
(for single prediction)
understand feature(s)
understand entire model
129. • ある観察 xについて、変数選択後の予測値と、もとの予測値 と
の距離を1変数ずつ繰り返し評価する。
• 増減の順序がキモになるが、当然、組み合わせ爆発を起こす。
• breakDownパッケージでは、stepwise selectionを採用。
• Step-down:
• いわゆる Backward elimination
• full model → model with empty set
• ロスを最小にするように変数を減らす
• Step-up
• いわゆる Forward selection
• model with empty set → Full model
• ゲインを最大にするように変数を増やす
https://arxiv.org/abs/1804.01955
breakDown
130. • ある観察 xについて、変数選択後の予測値と、もとの予測値 と
の距離を1変数ずつ繰り返し評価する。
• 増減の順序がキモになるが、当然、組み合わせ爆発を起こす。
• breakDownパッケージでは、stepwise selectionを採用。
• Step-down:
• いわゆる Backward elimination
• full model → model with empty set
• ロスを最小にするように変数を減らす
breakDown
Step-upは、この逆をする (model with empty set → Full model)
https://arxiv.org/abs/1804.01955
140. Interpretability book
Christoph Molnar(2019) "Interpretable Machine Learning: A Guide for
Making Black Box Models Explainable."
• https://christophm.github.io/interpretable-ml-book/
Przemysław Biecek (2018) "DALEX: Descriptive mAchine Learning
EXplanations"
• https://pbiecek.github.io/DALEX_docs/
参照リスト
142. R packages
mlr: Machine Learning in R
• https://cran.r-project.org/package=mlr
iml: Interpretable Machine Learning
• https://cran.r-project.org/package=iml
DALEX: Descriptive mAchine Learning EXplanations
• https://cran.r-project.org/package=DALEX
breakDown: Model Agnostic Explainers for Individual Predictions
• https://cran.r-project.org/package=breakDown
参照リスト
143. その他
mlr
• Machine Learning in R
• https://mlr-org.com/
• Machine Learning in R - Next Generation (mlr3)
• https://mlr3.mlr-org.com/
ALE plot
• Visualizing the Effects of Predictor Variables in Black Box Supervised
Learning Models
• Daniel Apley
• the Joint Statistical Meetings 2017
• https://arxiv.org/abs/1612.08468
• https://ww2.amstat.org/meetings/jsm/2017/onlineprogram/AbstractDetails.cfm?abstr
actid=324823
参照リスト
144. その他
H-statistic in RuleFit
• Predictive learning via rule ensembles.
• Friedman, Jerome H, and Bogdan E Popescu
• The Annals of Applied Statistics. JSTOR, 916–54. (2008)
• https://projecteuclid.org/euclid.aoas/1223908046
LIME
• Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin (2016) "Why
Should I Trust You?": Explaining the Predictions of Any Classifier
• KDD ‘16 Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge
Discovery and Data Mining Pages 1135-1144
• https://arxiv.org/abs/1602.04938
• lime: Local Interpretable Model-Agnostic Explanations
• https://cran.r-project.org/web/packages/lime/vignettes/Understanding_lime.html
参照リスト
145. その他
Shapley value
• A Unified Approach to Interpreting Model Predictions
• Scott M. Lundberg and Su-In Lee
• Advances in Neural Information Processing Systems 30 (NIPS 2017)
• https://papers.nips.cc/paper/7062-a-unified-approach-to-interpreting-model-
predictions
• Explaining prediction models and individual predictions with feature
contributions
• Štrumbelj, Erik and Igor Kononenko
• Knowledge and information systems 41.3 (2014): 647-665.
• https://www.semanticscholar.org/paper/Explaining-prediction-models-and-individual-
with-%C5%A0trumbelj-Kononenko/eb89cd70cbcfda0c350333b5a938d5da3b7b435f
breakDown
• Explanations of Model Predictions with live and breakDown Packages
• Mateusz Staniak and Przemysław Biecek
• The R Journal (2018) 10:2, pages 395-409.
• https://journal.r-project.org/archive/2018/RJ-2018-072/index.html
参照リスト
146. その他
the alternate features search
• S. Hara, T. Maehara, Finding Alternate Features in Lasso,
arXiv:1611.05940, 2016.
• https://github.com/sato9hara/LassoVariants
• https://github.com/katokohaku/AlternateLassoR
•
XGBoostExplainer: An R package that makes xgboost models fully
interpretable
• https://github.com/AppliedDataSciencePartners/xgboostExplainer
• https://medium.com/applied-data-science/new-r-package-the-xgboost-explainer-
51dd7d1aa211
• http://kato-kohaku-0.hatenablog.com/entry/2018/12/14/002253
参照リスト