250x250
Link
๋‚˜์˜ GitHub Contribution ๊ทธ๋ž˜ํ”„
Loading data ...
Notice
Recent Posts
Recent Comments
๊ด€๋ฆฌ ๋ฉ”๋‰ด

Data Science LAB

[Python] Mac Graphviz ์„ค์น˜ ๋ณธ๋ฌธ

๐Ÿ›  Machine Learning/์ง€๋„ ํ•™์Šต

[Python] Mac Graphviz ์„ค์น˜

ใ…… ใ…œ ใ…” ใ…‡ 2022. 9. 23. 15:43
728x90

์˜์‚ฌ๊ฒฐ์ •๋‚˜๋ฌด๋ฅผ ์‹œ๊ฐํ™”ํ•˜๊ธฐ ์œ„ํ•œ ํŒจํ‚ค์ง€์ธ Graphviz ์„ค์น˜ ๋ฐฉ๋ฒ•

 

Homebrew ์„ค์น˜

2022.09.15 - [Python] Mac์—์„œ tesseract ์„ค์น˜ํ•˜๊ธฐ ๋ฐ ํ•œ๊ธ€ ์ถ”๊ฐ€

 

[Python] Mac์—์„œ tesseract ์„ค์น˜ํ•˜๊ธฐ ๋ฐ ํ•œ๊ธ€ ์ถ”๊ฐ€

์ด๋ฒˆ์— ๋งฅ๋ถ ํ”„๋กœ๋กœ ๋…ธํŠธ๋ถ์„ ๋ณ€๊ฒฝํ•˜๋ฉด์„œ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ค์ •์„ ๋‹ค์‹œํ•˜๋Š”๋ฐ ์ƒ๊ฐ๋ณด๋‹ค ๋„ˆ๋ฌด ์–ด๋ ค์šด ๊ฒƒ,,,ใ…Ž,,,,, tesseract ์„ค์น˜ ๋ฐฉ๋ฒ• 1. Homebrew ์„ค์น˜ https://brew.sh/index_ko Homebrew The Missing Package Manage..

suhye.tistory.com

์—ฌ๊ธฐ ์•ž๋ถ€๋ถ„ ์ฐธ๊ณ 

 

 

ํ„ฐ๋ฏธ๋„์—์„œ graphviz ํŒจํ‚ค์ง€ ์ถ”๊ฐ€

brew install graphviz

 

 

pip ์„ค์น˜

pip install graphviz

 

 

 

from sklearn.tree import export_graphviz

export_graphviz(dt_clf, out_file = 'tree.dot', class_names=iris_data.target_names,
                feature_names=iris_data.feature_names, impurity=True, filled=True)

 

tree.dot๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ์‹œ๊ฐํ™” ํŒŒ์ผ ์ƒ์„ฑ

 

 

์‹œ๊ฐํ™” ํŒŒ์ผ ํ™•์ธ

import graphviz

with open('tree.dot') as f:
    dot_graph = f.read()
graphviz.Source(dot_graph)

728x90
Comments