0

I'm trying to visualize the result of by CatBoostClassifier in Databricks. I have graphviz ==0.18.2 installed on my cluster.

When I use the following code (NB. model is my trained CatBoostClassifier):

model.plot_tree(tree_idx=0)

I don't get a tree, but I get the following output: <graphviz.graphs.Digraph at 0x7f86330d9640>.

This doesn't seem to happen in this post.

Any suggestions on how I can visualize my tree?

brenda89
  • 99
  • 9
  • "graphviz ==0.18.2" is non-standard version. Please report output from "dot -V" – sroush Nov 20 '21 at 22:17
  • It is the latest version of Graphiz, as reporter here: https://pypi.org/project/graphviz/ . How do I get dot-v output, – brenda89 Nov 22 '21 at 07:12
  • At a command line prompt (Linux shell or Windows cmd/powershell) type "dot -V" – sroush Nov 22 '21 at 17:50
  • 1
    I believe you only installed an interface to Graphviz, but not the actual Graphviz package itself. This seems to be a common problem, the pypi documentation seems flawed. Search stackoverflow for "graphviz python" – sroush Nov 22 '21 at 17:54
  • Thanks, that might actually be the case. I figured graphiz was a working library, but that might not be the case. I need this to work on Databricks so Powershell is unfortunately not an option for me. – brenda89 Nov 23 '21 at 15:58

0 Answers0