Und zwar hab ich in der conda shell die beiden befehle benutzt:
conda install graphviz
pip install graphviz
hat alles geklappt, doch ich bekomme einen error:
ExecutableNotFound: failed to execute ['dot', '-Tpng', '-O', 'tmp'], make sure the Graphviz executables are on your systems' PATH
gesamter Code:
import numpy as np
import mglearn
import graphviz
X = np.array([[0,1,0,1],[1,0,1,1],[0,0,0,1],[1,0,1,0]])
y = np.array([0,1,0,1])
counts = {}
for label in np.unique(y):
counts [label] = X[y == label].sum(axis = 0)
print("Anzahl der Merkmale:\n{}".format(counts))
mglearn.plots.plot_animal_tree()
gesamter Fehlercode:
unfile('C:/Users/neoxx/.spyder-py3/unbenannt4.py', wdir='C:/Users/neoxx/.spyder-py3')
Anzahl der Merkmale:
{0: array([0, 1, 0, 2]), 1: array([2, 0, 2, 1])}
Traceback (most recent call last):
File "<ipython-input-2-9d6afc21156f>", line 1, in <module>
runfile('C:/Users/neoxx/.spyder-py3/unbenannt4.py', wdir='C:/Users/neoxx/.spyder-py3')
File "C:\Users\neoxx\Anaconda3.1\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
execfile(filename, namespace)
File "C:\Users\neoxx\Anaconda3.1\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/neoxx/.spyder-py3/unbenannt4.py", line 18, in <module>
mglearn.plots.plot_animal_tree()
File "C:\Users\neoxx\Anaconda3.1\lib\site-packages\mglearn\plot_animal_tree.py", line 25, in plot_animal_tree
mygraph.render("tmp")
File "C:\Users\neoxx\Anaconda3.1\lib\site-packages\graphviz\files.py", line 188, in render
rendered = backend.render(self._engine, format, filepath, renderer, formatter)
File "C:\Users\neoxx\Anaconda3.1\lib\site-packages\graphviz\backend.py", line 183, in render
run(cmd, capture_output=True, check=True, quiet=quiet)
File "C:\Users\neoxx\Anaconda3.1\lib\site-packages\graphviz\backend.py", line 150, in run
raise ExecutableNotFound(cmd)
ExecutableNotFound: failed to execute ['dot', '-Tpng', '-O', 'tmp'], make sure the Graphviz executables are on your systems' PATH
Wäre nett wenn mir jemand helfen könnte :3