角:为什么我的shap值尺寸[sample_num,feature,class]而不是[class,sample_num,功能]?

问题描述 投票:0回答:1

为什么所有AI都认为塑形值的计算如下?

X_sample = pd.DataFrame(X_train_resampled, columns=X.columns)[:500] explainer_rf = shap.TreeExplainer(rf_model) shap_values_rf = explainer_rf.shap_values(X_sample)
结果

shap_values_rf

尺寸应为[class,sample_num,功能],但实际上,我的输出是[sample_num,feature,class]。我迫切需要对此进行合理的解释。
无效,我尝试了许多AI来生成Shap摘要图,并且尺寸似乎存在问题。即使使用默认的IRIS数据集,描述的问题仍然存在。 AI始终假设类维度处于第一个位置。
    

可能只是因为您正在执行最新版本,因此开发人员只是更改了Argu的维度。许多接受过旧文档培训的AI模型仍然参考先前的格式

python machine-learning model artificial-intelligence shap
1个回答
0
投票

© www.soinside.com 2019 - 2025. All rights reserved.