“RuntimeError: Make sure the Graphviz executables are on your system's path” after installing Graphviz 2.38

后端 未结 29 2295
感动是毒
感动是毒 2020-12-02 06:00

I downloaded Graphviz 2.38 MSI version and installed under folder C:\\Python34, then I run pip install Graphviz, everything went well.

29条回答
  •  日久生厌
    2020-12-02 06:27

    1) Graphviz – download unzip in a particular place in the system (pip does not work in windows ) and include the bin folder in the path (‘set environment variables in windows’ OR) set manually in each program

    import os
    os.environ["PATH"] += os.pathsep + 'C:/GraphViz/bin'
    

    2) Then put the model to plot

    clf = xgb.train(params, d_train, 1000, evals=evallist, early_stopping_rounds=10)
    xgb.plot_tree(clf)
    plt.rcParams['figure.figsize'] = [50, 10]
    plt.show()
    

提交回复
热议问题