Skip to content

Commit

Permalink
Update kNN_test04.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Cherish authored Mar 2, 2018
1 parent b9df041 commit bc08cb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kNN/3.数字识别/kNN_test04.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def handwritingClassTest():
trainingMat[i,:] = img2vector('trainingDigits/%s' % (fileNameStr))
#构建kNN分类器
neigh = kNN(n_neighbors = 3, algorithm = 'auto')
#拟合模型, trainingMat为测试矩阵,hwLabels为对应的标签
#拟合模型, trainingMat为训练矩阵,hwLabels为对应的标签
neigh.fit(trainingMat, hwLabels)
#返回testDigits目录下的文件列表
testFileList = listdir('testDigits')
Expand Down

0 comments on commit bc08cb3

Please sign in to comment.