Python Jupyter笔记本SHAP force_plot,如何更改深色主题的背景颜色或文本颜色?

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

enter image description here

有什么方法可以更改深色主题中的图形显示背景颜色或文本颜色?我需要白色背景或白色文字。

该图是IPython.core.display.HTML的对象。

由...生成

shap.force_plot(explainer.expected_value[1], shap_values[1][0,:], X_test.iloc[0,:],link="logit")

感谢您的帮助!

python html node.js jupyter-notebook shap
1个回答
0
投票

添加matplotlib=True的参数后,问题已解决。

shap.force_plot(explainer.expected_value[1], shap_values[1][0,:], X_test.iloc[0,:],link="logit", matplotlib=True)

似乎该图是使用matplotlib在html文件上创建的。

为了正确绘图,我首先使用style.use('seaborn-dark')在Jupyter笔记本的深色模型中。

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