[問題] decision tree畫圖
最近剛剛學習python
在看到sklearn裡面的決策樹例子(iris)
最後代碼都是存成一個pdf出來
想請問說有辦法在PYTHON裡面顯示出來嗎?(就不另外存pdf出來)
我依照參數設定
from IPython.display import Image
dot_data = tree.export_graphviz(clf, out_file=None,
feature_names=iris.feature_names,
class_names=iris.target_names,
filled=True, rounded=True,
special_characters=True)
graph = pydotplus.graph_from_dot_data(dot_data)
Image(graph.create_png())
總會閃一下 然後就不見了 請問是遇到了什麼問題?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 97.68.49.3
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1525297179.A.EBB.html
→
05/03 05:56,
6年前
, 1F
05/03 05:56, 1F
→
05/03 05:56,
6年前
, 2F
05/03 05:56, 2F
→
05/03 06:12,
6年前
, 3F
05/03 06:12, 3F
→
05/03 06:12,
6年前
, 4F
05/03 06:12, 4F
→
05/04 16:10,
6年前
, 5F
05/04 16:10, 5F
※ 編輯: mikeliang (73.21.209.15), 05/06/2018 11:50:35
→
05/06 11:51,
6年前
, 6F
05/06 11:51, 6F