list indices must be integers or slices, not tuple

 File "E:\Python36\regtree.py", line 45, in chooseBestSplit
    if len(set(dataSet[:,-1].T.tolist()[0])) == 1: #exit cond 1

TypeError: list indices must be integers or slices, not tuple

在测试树回归的时候,一直报这个错,找了很久的原因,后来发现是因为输入的数据集没有转为矩阵

posted @ 2017-12-26 17:11  crr121  阅读(11161)  评论(0编辑  收藏  举报