我尝试使用 DeepExplainer 计算 shap 值,但出现以下错误:
不再支持 keras,请改用 tf.keras
即使我使用 tf.keras?
KeyError Traceback(最近一次调用最后一次)
在
6 # ...或者直接传递张量
7 解释器 = shap.DeepExplainer((model.layers[0].input, model.layers[-1].output), 背景)
8 shap_values = 解释器.shap_values(X_test[1:5])
C:\ProgramData\Anaconda3\lib\site-packages\shap\explainers\_deep\__init__.py in shap_values(self、X、ranked_outputs、output_rank_order、check_additivity)
122 人被选为“顶级”。
[第 124 章]
C:\ProgramData\Anaconda3\lib\site-packages\shap\explainers\_deep\deep_tf.py 在 shap_values(self、X、ranked_outputs、output_rank_order、check_additivity)
[第 310 章]
[第 311 章]
[第 312 章]
313
第314章
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py 中 __getitem__(self, key)
第2798章
第2799章
第2800章
第2801章
第2802章
get_loc 中的 C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py(self、key、method、tolerance)
第2646章
第2647章
第2648章
第2649章
第2650章
pandas\_libs\index.pyx 在 pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\index.pyx 在 pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\hashtable_class_helper.pxi 在 pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas\_libs\hashtable_class_helper.pxi 在 pandas._libs.hashtable.PyObjectHashTable.get_item()
密钥错误:0
import shap …Run Code Online (Sandbox Code Playgroud)