adaboost算法报错

Traceback (most recent call last):
  File "E:/PythonPro/machine_learning/Combat4/adaboost.py", line 161, in
    prediction10 = adaClassify(testArr, classifierArray)
  File "E:/PythonPro/machine_learning/Combat4/adaboost.py", line 97, in adaClassify
    classEst = stumpClassify(dataMatrix,classifierArr[i]['dim'],\
KeyError: 'dim'

X、Y对应的数据索引要指定正确

X = dataset[:, 0:44]
Y = dataset[:, 44]

Y代表的就是数据对应的二值结果

你可能感兴趣的:(Machine,learning,机器学习,adaboost算法)