我开始学习机器学习。我正在遵循一个google教程,但是我面对这个错误,我发现的答案在我的代码中不起作用。我不确定,但Python版本似乎已经改变,不再使用某些库了。在
这是错误:
[0 1 2]
[0 1 2]
Warning (from warnings module):
File "C:\Users\Moi\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sklearn\externals\six.py", line 31
"(https://pypi.org/project/six/).", DeprecationWarning)
DeprecationWarning: The module is deprecated in version 0.21 and will be removed in version 0.23 since we've dropped support for Python 2.7. Please rely on the official version of six (https://pypi.org/project/six/).
Traceback (most recent call last):
File "C:\Users\Moi\Desktop\python\ML\decision tree.py", line 30, in <module>
graph.write_pdf("iris.pdf")
AttributeError: 'list' object has no attribute 'write_pdf'
代码如下:
^{pr2}$
graph_from_dot_data
返回一个元组,必须分解它才能得到图形。在更改:
收件人:
^{pr2}$贷方:https://www.programcreek.com/python/example/84621/pydot.graph_from_dot_data
相关问题 更多 >
编程相关推荐