mirror of
https://gitee.com/TheAlgorithms/Statistical-Learning-Method_Code.git
synced 2024-12-22 20:54:21 +08:00
Update DecisionTree.py
support for python >=3.6
This commit is contained in:
parent
717d59536a
commit
d19687aba3
@ -279,7 +279,7 @@ def predict(testDataList, tree):
|
|||||||
#如果当前value不是字典,那就返回分类值
|
#如果当前value不是字典,那就返回分类值
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def test(testDataList, testLabelList, tree):
|
def model_test(testDataList, testLabelList, tree):
|
||||||
'''
|
'''
|
||||||
测试准确率
|
测试准确率
|
||||||
:param testDataList:待测试数据集
|
:param testDataList:待测试数据集
|
||||||
@ -313,7 +313,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
#测试准确率
|
#测试准确率
|
||||||
print('start test')
|
print('start test')
|
||||||
accur = test(testDataList, testLabelList, tree)
|
accur = model_test(testDataList, testLabelList, tree)
|
||||||
print('the accur is:', accur)
|
print('the accur is:', accur)
|
||||||
|
|
||||||
#结束时间
|
#结束时间
|
||||||
|
Loading…
Reference in New Issue
Block a user