我正在练习在jupyter笔记本中使用graphviz创建决策树的练习。但是,决策树范围太广。这是代码:
from sklearn.tree import export_graphviz
export_graphviz(tree, out_file="tree.dot", class_names=["malignant", "benign"],
feature_names=cancer.feature_names, impurity=False, filled=True)
with open("tree.dot") as f:
dot_graph = f.read()
display(graphviz.Source(dot_graph))
我必须滚动才能看到决策树的左侧。我可以减小宽度吗?怎么样?