目錄
1、ID3算法
2、使用sklearn API——模型保存和調用成功
1、ID3算法
以下實現了決策樹的創建、可視化繪制、決策樹的保存和調用
但是在利用決策樹進行預測的時候出現錯誤
分類代碼
#實用決策樹進行分類
def classify(inputTree, featLabels, testVec): firstStr = inputTree.keys()[0] secondDict = inputTree[firstStr] featIndex = featLabels.index(