python - Python Jupyter notebook SHAP force_plot,如何更改深色主题中的背景颜色或文本颜色?
问题描述
有什么方法可以更改深色主题中的绘图背景颜色或文本颜色?我需要白色背景或白色文本。
该图是 IPython.core.display.HTML 的一个对象。
它是由
shap.force_plot(explainer.expected_value[1], shap_values[1][0,:], X_test.iloc[0,:],link="logit")
谢谢您的帮助!
解决方案
加上 的参数后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 notebook 的深色模型中使用。
推荐阅读
- javascript - 如何将两个对象与一个对象的某些属性和另一个对象的其他属性合并?
- twilio - Twilio 自动驾驶仪和金额
- linux - RH 6.1、7.4、7.6 ssh 中与用户相关的错误以及 LD_LIBRARY_PATH 和 openmpi mpiexec 的设置
- vba - 通过匹配访问表单中的两个字段来搜索表单
- java - Vertx 中的异步自定义方法
- flutter - 颤动轮播图像滑块在点击时打开单独的页面
- javascript - 有什么实用的方法可以在组件中调用“React.createContext()”吗?
- javascript - 从 Google 脚本中检索数据
- python - 如何将 OAuth1 与 aiohttp 一起使用
- python - 如何使用 Python Pandas 对数据框进行排序以匹配文件和发票金额