1

我试图用catboostin绘制分类器树jupyter notebook
但是,它似乎不受Python 3.

我按照此链接进行绘图,但出现错误。

---------------------------------------------------------------------------
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'

似乎该字符串python 3不再具有解码方法。(这里)有
什么建议吗?

4

0 回答 0