@starburks001 (おう う)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

mac環境で決定木を図示したい。

解決したいこと

mac環境で決定木を図示したい。

決定木を図示する為に、pydotplusやgraphvizをインストールする方法を教えていただけますと幸いです。

0 likes

2Answer

graphviz

MacPortsHomebrewのいずれかで可能。MacPortsHomebrewは別途インストールが必要

公式サイトより引用

MacPorts* provides both stable and development versions of Graphviz and the Mac GUI Graphviz.app.
These can be obtained via the ports graphviz, graphviz-devel, graphviz-gui and graphviz-gui-devel.

sudo port install graphviz

Homebrew* has a Graphviz port.

brew install graphviz

pydotplus

pipを介してインストール可能。pippythonに標準搭載されている
公式サイトより引用

Installation

pip install pydotplus

0Like

ご回答ありがとうございました。

以下のリンク通りにmacにgraphvizをインストールしたが、
https://analytics-note.xyz/mac/mac-graphviz-install/
macでjupyter notebookにコードbrew install graphvizを打ち、実行すれば、
以下のエラーが得ました。 bash: brew: command not foundです。

次に、macでjupyter notebookにコードbrew install graphvizを打ちpip install graphvizを実行すれば、 successfully installed graphviz-0.20が得ました。

最後に、pip install pydotplusを実行すれば、successfully installed pydotpuls-2.0.2が得ました。

この環境で、決定木を可視化すれば、以下のエラーが得ました。 InvocationException: GraphViz's executable "C:\Program Files\Graphviz\bin\dot.exe" is not a file or doesn't exist

解決方法を教えていただけますと幸いです。 宜しくお願い申し上げます。

0Like

Your answer might help someone💌