python-Xgboost可视化问题 You must install graphviz to plot tree
2016-12-15 12:22
2927 查看
xgboost
代码
遇到问题
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
代码
# plot decision tree from numpy import loadtxt from xgboost import XGBClassifier from xgboost import plot_tree import matplotlib.pyplot as plt from graphviz import Digraph # load data import pydot # print pydot.find_graphviz() dataset = loadtxt('pima-indians-diabetes.csv', delimiter=",") # split data into X and y X = dataset[:, 0:8] y = dataset[:, 8] # fit model no training data model = XGBClassifier() model.fit(X, y) # plot single tree plot_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
相关文章推荐
- ImportError: 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.
- ImportError: 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...-keras使用pydot出错(ubuntu16.04)
- 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.
- SimpleCV install and "You need the python image library to save by filehandle"
- You must use the Role Management Tool to install or configure Microsoft .NET Framework 3.5 SP1
- python setup.py install安装遇到问题:unable to find vcvarsall.bat
- 驱动程序找不到内核头提示 You do not appear to have the sources for the “kernel version” kernel install 问题
- Complete Guide to Parameter Tuning in XGBoost (with codes in Python)
- What you absolutely must know to use boost smart pointers correctly
- Ubuntu 下安装Git时遇到的问题 - You might want to run 'apt-get -f install' to correct these
- Complete Guide to Parameter Tuning in XGBoost (with codes in Python)
- xgboost python windows编译问题
- 安装Laravel遇到You must enable the openssl extension to download files via https问题
- FreeSWITCH安装报错“You must install libyuv-dev to build mod_fsv”的解决方案
- Server 2008 R2: “You must use the Role Management Tool to install or configure Microsoft .NET”