我尝试在catboost
中用jupyter notebook
绘制分类树。
但是,Python 3
似乎不支持它。
我按照this link进行了绘制,但是出现了错误。
---------------------------------------------------------------------------
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
中的字符串似乎不再具有解码方法。(HERE)
有什么建议吗?