我无法在 Azure Data Studio Notebook 中运行 shap.initjs()。放弃在 Azure 社区论坛或其他地方查找问题。
shap.initjs()
test_sample = test_x.iloc[:2000,:]
shap_values_sample = explainer.shap_values(test_sample)
shap.force_plot(explainer.expected_value[1], shap_values_sample[1], test_sample, link="logit")
Run Code Online (Sandbox Code Playgroud)