Python, PyDot and DecisionTree

前端 未结 3 1638
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-04 11:52

I\'m trying to visualize my DecisionTree, but getting the error The code is:

X = [i[1:] for i in dataset]#attribute
y = [i[0] for i in dataset]
clf = tree.Decisi         


        
3条回答
  •  别跟我提以往
    2021-02-04 12:43

    The line in question is checking to see if the stream/file is encoded as UTF-8

    Instead of:

    if data.startswith(codecs.BOM_UTF8):
    

    use:

    if codecs.BOM_UTF8 in data:
    

    You will likely have more success...

提交回复
热议问题