In:
!pip install graphviz==0.17
!apt-get install
!apt-get update
#Também tentei sem a 3a linha, mas não funcionou
Out: Requirement already satisfied: graphviz==0.17 in /usr/local/lib/python3.7/dist-packages (0.17)
Reading package lists... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Hit:2 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ InRelease Ign:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease Ign:4 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 InRelease Hit:5 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu bionic InRelease Hit:6 http://archive.ubuntu.com/ubuntu bionic InRelease Hit:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 Release Hit:8 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 Release Hit:9 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Hit:10 http://ppa.launchpad.net/cran/libgit2/ubuntu bionic InRelease Hit:11 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Hit:12 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease Hit:13 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease Fetched 88.7 kB in 6s (15.4 kB/s) Reading package lists... Done
In:
from sklearn.tree import export_graphviz
dot_data = export_graphviz(model, out_file=None)
graph = graphviz.Source(dot_data)
graph
#As variáveis estão em inglês também no resto do código
Out:
NameError Traceback (most recent call last)
in () 2 3 dot_data = export_graphviz(model, out_file=None) ----> 4 graph = graphviz.Source(dot_data) 5 graph
NameError: name 'graphviz' is not defined