【问题标题】:python : graphviz not show bigger or smaller markpython:graphviz不显示更大或更小的标记
【发布时间】:2020-09-22 03:44:39
【问题描述】:

下图中的这个问题。 在 Windows 10 操作系统中。 和 jupyter 笔记本。 和版本 python 3.8。 使用 graphviz 创建图像。

在红色标记的地方。 它应该显示一个更大的迹象。 在 jupyter notebook 中编写 python 代码。

import sklearn.datasets as datasets
import pandas as pd
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split

from sklearn.externals.six import StringIO  
from IPython.display import Image  
from sklearn.tree import export_graphviz
import pydotplus
dtree=DecisionTreeClassifier(max_depth=2)
dtree.fit(X_train,y_train)

dot_data = StringIO()
export_graphviz(dtree, out_file=dot_data, filled=True, rounded=True, 
special_characters=True, feature_names=X_train.columns)
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())  
Image(graph.create_png())

请帮帮我。

【问题讨论】:

    标签: python python-3.x jupyter-notebook graphviz


    【解决方案1】:

    您没有显示您的 python 代码,但这直接在 dot: 中起作用:

    digraph "le" {
      le [label="look ≤ here"]
    }
    

    【讨论】:

      【解决方案2】:

      解决错误。一个操作系统是windows。我在 linux 中尝试 安装 Graivis sudo apt-get install graphviz 而不是问题。 但是在windows os中没有解决一个问题

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-03-05
        • 2021-06-06
        • 1970-01-01
        • 2017-06-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多