---
# System prepended metadata

title: Explainable AI (XAI)

---

# Explainable AI (XAI)



## Explainable AI (XAI) 解釋(太詳細 有空再看)
作者-Seungjun (Josh) Kim

### PDP(Partial Dependence Plot)
[Partial Dependence Plot (PDP) -part1](https://medium.com/towards-data-science/explainable-ai-xai-methods-part-1-partial-dependence-plot-pdp-349441901a3d)

[Individual Conditional Expectation (ICE) Curves -Part 2](https://medium.com/towards-data-science/explainable-ai-xai-methods-part-2-individual-conditional-expectation-ice-curves-8fe76919aab7)



### ALE(Accumulated Local Effects Plot)(R語言)
[Accumulated Local Effects (ALE)-Part 3](https://medium.com/towards-data-science/explainable-ai-xai-methods-part-3-accumulated-local-effects-ale-cf6ba3387fde)

[參考網址](https://medium.com/sherry-ai/xai-%E7%B4%AF%E7%A9%8D%E5%B1%80%E9%83%A8%E6%95%88%E6%87%89-ale-e6e2bc0fbeeb)
累積局部效應（ALE）主要用來描述特徵與預測值的平均關係，基本上與 PDP 的功能相同，但 ALE 利用了條件分布（ Conditional Distribution）的概念，擺脫了「特徵獨立的假設」使得結果更於穩健。因此，在應用上 ALE 是比 PDP(Partial Dependence Plot) 更廣泛的 。

[Permutation Feature Importance-Part 4](https://medium.com/geekculture/explainable-ai-xai-methods-part-4-permutation-feature-importance-72b8a5d9be05)

[ Global Surrogate Models-Part 5](https://medium.com/towards-data-science/explainable-ai-xai-methods-part-5-global-surrogate-models-9c228d27e13a)

---


## Package + 實作範例



### LIME
SuperPixels:將每一pixel附近相近的pixels混合成一塊segment，每一塊segment都可稱為superpixel，並且可被轉換成特徵

[文獻](https://arxiv.org/abs/1602.04938)
[github](https://github.com/marcotcr/lime)

``` python=

```

### SHARP
Game theory
[介紹文章](https://medium.com/@d246810g2000/%E5%8F%AF%E8%A7%A3%E9%87%8B-ai-xai-%E7%B3%BB%E5%88%97-shap-2c600b4bdc9e)

[SHARP實作1](https://medium.com/ai-academy-taiwan/explain-your-machine-learning-model-by-shap-part-1-228fb2a57119)

[SHARP實作2](https://medium.com/ai-academy-taiwan/explain-your-machine-learning-model-by-shap-part-2-df1afd9fa06f)

[SHAP for interpreting ML models explained with codes](https://medium.com/data-science-in-your-pocket/shap-for-interpreting-ml-models-explained-with-codes-e94baf5a204e)

[Feature Importance Analysis with SHAP I Learned at Spotify (with the Help of the Avengers)](https://towardsdatascience.com/feature-importance-analysis-with-shap-i-learned-at-spotify-aacd769831b4)

[Text data+Transformer model+SHAP](https://towardsdatascience.com/explainable-machine-learning-for-models-trained-on-text-data-combining-shap-with-transformer-5095ea7f3a8)


### SHAPASH
此package可以用上述兩種(LIME/SHARP)做為後端，產出更優秀的可視化圖型

### InterpretML


### eli5
支援框架:
* scikit-learn
* keras
* XGBoost 

### 

---

## 參考網站
[Explainable AI (XAI) — A guide to 7 Packages in Python to Explain Your Models](https://towardsdatascience.com/explainable-ai-xai-a-guide-to-7-packages-in-python-to-explain-your-models-932967f0634b)

[用LIME模型解釋](https://ithelp.ithome.com.tw/articles/10305530)

