Update AdaBoost.py

support for python >=3.6
This commit is contained in:
Dod-o 2020-01-23 01:29:03 +08:00 committed by GitHub
parent 972a87b208
commit 717d59536a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,7 +213,7 @@ def predict(x, div, rule, feature):
if x[feature] < div: return L
else: return H
def test(testDataList, testLabelList, tree):
def model_test(testDataList, testLabelList, tree):
'''
测试
:param testDataList:测试数据集
@ -261,7 +261,7 @@ if __name__ == '__main__':
#测试
print('start to test')
accuracy = test(testDataList[:1000], testLabelList[:1000], tree)
accuracy = model_test(testDataList[:1000], testLabelList[:1000], tree)
print('the accuracy is:%d' % (accuracy * 100), '%')
#结束时间