mirror of
https://gitee.com/TheAlgorithms/Statistical-Learning-Method_Code.git
synced 2024-12-21 20:37:08 +08:00
Update AdaBoost.py
support for python >=3.6
This commit is contained in:
parent
972a87b208
commit
717d59536a
@ -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), '%')
|
||||
|
||||
#结束时间
|
||||
|
Loading…
Reference in New Issue
Block a user