|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
决策树分析时
dtc=DTC(criterion='entropy') #使用信息熵作为划分标准,对决策树进行分类
dtc.fit(x,y) # 对决策树进行训练
dot_data = tree.export_graphviz(dtc)
# graph = pydotplus.graph_from_dot_data(dot_data)
graph = graphviz.Source(dot_data)
pic=plot_tree(dtc)
plt.savefig((r'C:\Users\chenj\Desktop\tree_visualization.png')
运行到最后一步plt.savefig((r'C:\Users\chenj\Desktop\tree_visualization.png'),显示错误为:
Coverage is not importable in this environment. Please install coverage.py to selected interpreter or enable 'Use bundled coverage' in Settings | Coverage
但是pycharm 或者直接在CMD 中 pip install coverage 但安装不上,提示错误为:ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/9c/7d/dc510d76ef49034d3c6c52a173e64c367c309cdf75fdb4872eaf122ada50/coverage-5.3.1-cp39-cp39-win_amd64.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001EAB315F0D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')) |
|