­

XAI/MLI 可解釋機器學習系列1- 開源&paper匯總

一直在關注可解釋機器學習領域,因為確實在工作中有許多應用

  • 模型檢查,特徵重要性是否符合預期和AUC一樣重要
  • 模型解釋,比起虛無縹緲的模型指標,解釋模型學到的規律更能說服業務方
  • 樣本解釋,為什麼這些用戶會違約,是否有指標能提前預警?
  • 決策歸因,有時模型只是提取pattern的方式,最終需要給到歸因/決策,例如HTE模型和XAI結合是否也是一種落地方式

18年被H2O Driverless AI 提供的可解釋機器學習引擎(下圖)種草後,就對這個領域產生了興趣。不過用的越多,XAI暴露的問題就越多,比如特徵的微調可能會導致整個特徵解釋發生翻天覆地的變化,再比如表現很好的模型會給出完全不能理解的特徵解釋。不過在接觸因果推理後希望可以換個視角來看XAI,於是重新撿起這個系列(挖坑慎入,這是一個18年就開始挖,到現在都沒有填完的坑)~

image.png-2335.1kB

Algo & paper

開源庫每個演算法只提供了一個,大多是原作者或者我用過的,並不一定是start最多的,要是你知道better source歡迎留言喲~

演算法 paper GitHub
Permutation Importance 【1】 eli5
Feature Importace 計算方法有多種【2】 LGB/XGB/sklearn自帶
Surrogate Model 【3】 h2o.ai
Local interpretable model_agnostic explanations(LIME) 【4】 lime
Leave one covariate out(LOCO) 【5】 h2o.ai
Individual Conditional Expectation(ICE) 【6】 PDPbox
Partial Dependence Plot(PDP) 【7】 PDPbox
shapley/SHAP 【8】【9】【10】 shap
DeepLift 【11】 deeplift
Layerwise Relevance Propagation(LRP) 【12】 LRP demo
Integrated Gradients 【13】 Integrated-Gradients

【1】Breiman, 2001, Random Forests
【2】方法有很多可以找xgb/lgb文檔來看
【3】Osbert Bastani, Carolyn Kim, and Hamsa Bastani, 2017. Interpreting Blackbox Models via Model Extraction.
【4】Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. Why should I trust you?: Explaining the predictions of any classifier. 2016
【5】Jing Lei, Max G』Sell, Alessandro Rinaldo, Ryan J. Tibshirani, and Larry Wasserman, 2016, Distribution-Free Predictive Inference For Regression
【6】Goldstein, Alex, et al, 2015, Peeking inside the black box: Visualizing statistical learning with plots of individual conditional expectation.
【7】J. H. Friedman, 2001, Greedy function approximation: a gradient boosting machine
【8】Lundberg, Scott M., and Su-In Lee, 2017. A unified approach to interpreting model predictions
【9】Lundberg, Scott M., Gabriel G. Erion, and Su-In Lee, 2018. Consistent individualized feature attribution for tree ensembles.
【10】Sundararajan, Mukund, and Amir Najmi, 2019, The many Shapley values for model explanation
【11】 Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje, 2017 . Learning important features through
propagating activation differences
【12】Sebastian Bach, Alexander Binder, Grégoire Montavon, Frederick Klauschen, Klaus-Robert Müller,
and Wojciech Samek, 2015. On pixel-wise explanations for non-linear classifier decisions by layer-wise
relevance propagation
【13】Mukund Sundararajan, Ankur Taly, and Qiqi Yan, 2017. Axiomatic attribution for deep networks

Tutorial

以下tutorial不同程度覆蓋了上述演算法,這兩年的只能看paper咯。

推薦第一本,據說是LMU2019年學生研討會的作業匯總。。。引入了因果的概念來分析在哪些情況下XAI會cheating,雖然大多是點到即止沒有深入,不過指出的一些坑命中率還是很高的>_< ,有一句話記憶很深刻 可解釋演算法解釋的是模型學到了什麼,而非實際數據表現如何

  1. Limitations of Interpretable Machine Learning Methods
  2. Interpretable Machine Learning, A Guide for Making Black Box Models Explainable.
  3. OREILLY, Ideas on interpreting machine learning
  4. Kaggle, Machine Learning Explainability
  5. H2O AI, An-Introduction-to-Machine-Learning-Interpretability-Second-Edition
  6. MLI-source
  7. h2o.ai interpretable_machine_learning_with_python
  8. h2o.ai awesome-machine-learning-interpretability

XAI的難度不在理解演算法本身,而是演算法和數據結合時,你需要知道什麼時候演算法會fail, 以及在模型解釋不如預期的時候如何追查原因。說白了就是要在玄學中找規律。。。所以後面我們會找個數據集來試試看

持續更新中~