Update DecisionTree.py

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

View File

@ -279,7 +279,7 @@ def predict(testDataList, tree):
#如果当前value不是字典那就返回分类值
return value
def test(testDataList, testLabelList, tree):
def model_test(testDataList, testLabelList, tree):
'''
测试准确率
:param testDataList:待测试数据集
@ -313,7 +313,7 @@ if __name__ == '__main__':
#测试准确率
print('start test')
accur = test(testDataList, testLabelList, tree)
accur = model_test(testDataList, testLabelList, tree)
print('the accur is:', accur)
#结束时间