if int(classifyVector(array(lineArr),trainWeights))!=currLine[21]:
errorCount+=1
改正:
if int(classifyVector(array(lineArr),trainWeights))!=int(currLine[21]):
errorCount+=1
解决!
the error rate of this test is:0.313433
the error rate of this test is:0.343284
the error rate of this test is:0.417910
the error rate of this test is:0.373134
the error rate of this test is:0.283582
the error rate of this test is:0.343284
the error rate of this test is:0.298507
the error rate of this test is:0.388060
the error rate of this test is:0.268657
the error rate of this test is:0.388060
after 10 iterations the average error rate is:0.341791