python-Xgboost可视化问题 You must install graphviz to plot tree
来源:互联网 发布:淘宝商家营销手段 编辑:程序博客网 时间:2024/06/08 11:14
xgboost
代码
# plot decision treefrom numpy import loadtxtfrom xgboost import XGBClassifierfrom xgboost import plot_treeimport matplotlib.pyplot as pltfrom graphviz import Digraph# load dataimport pydot# print pydot.find_graphviz()dataset = loadtxt('pima-indians-diabetes.csv', delimiter=",")# split data into X and yX = dataset[:, 0:8]y = dataset[:, 8]# fit model no training datamodel = XGBClassifier()model.fit(X, y)# plot single treeplot_tree(model)plt.show()
遇到问题
You must install graphviz to plot tree
解决办法
1. https://pypi.python.org/pypi/graphviz/0.3.3
2. pip install graphviz
Here is the web page of that graphviz. This is a python package called
graphviz. Bad choice of name. You need to install the c version of
graphvis. See this web page:https://pypi.python.org/pypi/graphviz/0.3.3
From the command line, the command “dot” should work. Look into you OS to
know if it provide graphviz. If so, it will be probably the c version.Fred
参考资料:
- https://github.com/Theano/Theano/issues/1801
0 0
- python-Xgboost可视化问题 You must install graphviz to plot tree
- Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- Failed to import pydot. You must install pydot and graphviz...-keras使用pydot出错(ubuntu16.04)
- ImportError: You must install PIL to fetch image objects
- Graphviz -图形可视化,python实现
- keras可视化pydot graphviz问题
- Use Python to plot
- graphviz数据可视化 与Python交互
- Python决策树可视化Graphviz下载地址
- Server 2008 R2: “You must use the Role Management Tool to install or configure Microsoft .NET”
- Server 2008 R2: “You must use the Role Management Tool to install or configure Microsoft .NET”
- You must use the Role Management Tool to install or configure Microsoft .NET Framework 3.5
- FreeSWITCH安装报错“You must install libyuv-dev to build mod_fsv”的解决方案
- FreeSWITCH安装报错“You must install libyuv-dev to build mod_fsv”的解决方案
- Windows 2008 R2上安装Visual Studio 2008:you must use the role management tool to install configure .net
- SQL语句操作全集
- 动态注册广播
- Linux命令行部署weblogic
- Linux Ubuntu 12.04 下安装mysql 以及创建 远程navicat 连接
- BlogTest
- python-Xgboost可视化问题 You must install graphviz to plot tree
- [51nod1325]两棵树的问题
- A【1-1-12】C语言运算符优先级与结合方向
- 第15周项目1 -3 验证算法之希尔排序
- 概率相关的证明
- ADB命令
- 第16周实践项目三——点结构体(1)
- 用matlab弹奏卡农
- github项目之仿小猪巴士车牌显示