我遵循了在线数据科学课程,并尝试在应用程序中可视化决策树。
我首先编写如下代码:
!pip install graphviz
!apt-get install graphviz
OUTPUT: Requirement already satisfied: graphviz in c:\users\samet girgin\python\lib\site-packages (0.10.1)
'apt-get' is not recognized as an internal or external command,
operable program or batch file.
在这之后,我编写代码以摘取树:
输入:
import graphviz
from sklearn.tree import export_graphviz
dot_data=export_graphviz(model,out_file=None, feature_names=features,filled=True, rotate=True)
graphviz.Source(dot_data)
输出:出现如下错误
ExecutableNotFound: failed to execute ['dot', '-Tsvg'], make sure the Graphviz executables are on your systems' PATH
我应该怎么办?请帮忙?