1

I tried to plot the classifier tree with catboost in jupyter notebook.
However, it seems that it is not supported by Python 3.

I followed this link for plotting but got error.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-140-117bb3853789> in <module>
     12 model.plot_tree(
     13     tree_idx=0,
---> 14     pool=pool # "pool" is required parameter for trees with one hot features
     15 )

~\AppData\Local\Continuum\anaconda3\lib\site-packages\catboost\core.py in plot_tree(self, tree_idx, pool)
   2386             for node_num in range(layer_size):
   2387                 if split_num >= 0:
-> 2388                     node_label = splits[split_num].decode('utf-8').replace('bin=', 'value>', 1)
   2389                     color = 'black'
   2390                     shape = 'ellipse'

AttributeError: 'str' object has no attribute 'decode'

It seems that string in python 3 no longer has decode method.(HERE)
Any suggestion?

Peter Chen
  • 1,464
  • 3
  • 21
  • 48

0 Answers0