Python机器学习实战之k-近邻算法的实现


Posted in Python onNovember 27, 2021

K-近邻算法概述

简单地说, k-近邻算法采用测量不同特征值之间的距离方法进行分类。

k-近邻算法

  • 优点:精度高、对异常值不敏感、无数据输入假定。
  • 缺点: 计算复杂度高、空间复杂度高。

适用数据范围: 数值型和标称型。

工作原理

  • 存在一个样本数据集合, 也称作训练样本集, 并且样本集中每个数据都存在标签, 知道样本集中每一数据与所属分类的对应关系。
  • 输入没有标签的新数据后, 将新数据的每个特征与样本集中数据对应的特征进行比较, 然后算法提取样本集中特征最相似数据 (最近邻)的分类标签。
  • 一般来说, 只选择样本数据集中前 k个最相似的数据, 这就是k-近邻算法中k的出处, 通常 k 是不大于 20 的整数。
  • 最后, 选择 k个最相似数据中出现次数最多的分类, 作为新数据的分类。

k-近邻算法的一般流程

  1. 收集数据: 可以使用任何方法。
  2. 准备数据: 距离计算所需要的数值, 最好是结构化的数据格式。
  3. 分析数据: 可以使用任何方法。
  4. 训练算法: 此步骤不适用于 k-近邻算法。
  5. 测试算法: 计算错误率。
  6. 使用算法: 首先需要输入样本数据和结构化的输出结果, 然后运行 k-近邻算法判定输 入数据分别属于哪个分类, 最后应用对计算出的分类执行后续的处理。
from numpy import *
import operator
def createDataSet():
    group = array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]])
    labels = ['A','A','B','B']
    return group, labels
group, labels = createDataSet()
group
array([[1. , 1.1],
       [1. , 1. ],
       [0. , 0. ],
       [0. , 0.1]])
labels
['A', 'A', 'B', 'B']
a = tile([3,3],(4,1))
a
array([[3, 3],
       [3, 3],
       [3, 3],
       [3, 3]])

实施KNN算法

其伪代码如下:

对末知类别属性的数据集中的每个点依次执行以下操作:

  1. 计算已知类别数据集中的点与当前点之间的距离;
  2. 按照距离递增次序排序;
  3. 选取与当前点距离最小的k个点;
  4. 确定前k个点所在类别的出现频率;
  5. 返回前k个点出现频率最高的类别作为当前点的预测分类。
def classify0(inX, dataSet, labels, k):
    dataSetSize = dataSet.shape[0]
    diffMat = tile(inX,(dataSetSize,1)) - dataSet
    sqDiffMat = diffMat**2
    sqDistances = sqDiffMat.sum(axis=1)
    distances = sqDistances**0.5
    sortedDistIndicies = distances.argsort()
    classCount = {}
    for i in range(k):
        voteIlabel = labels[sortedDistIndicies[i]]
        classCount[voteIlabel] = classCount.get(voteIlabel,0) + 1
    sortedClassCount = sorted(classCount.items(),key = operator.itemgetter(1), reverse=True)
    return sortedClassCount[0][0]
classify0([0,0],group,labels,3)
'B'

示例:手写识别系统

数据集如下图:

Python机器学习实战之k-近邻算法的实现

示例: 使用k-近邻算法的手写识别系统

  1. 收集数据: 提供文本文件。
  2. 准备数据: 编写函数 classify0(), 将图像格式转换为分类器使用的list格式。
  3. 分析数据: 在Python命令提示符中检查数据, 确保它符合要求。
  4. 训练算法: 此步骤不适用于 k-近邻算法。
  5. 测试算法: 编写函数使用提供的部分数据集作为测试样本, 测试样本与非测试样本 的区别在于测试样本是已经完成分类的数据, 如果预测分类与实际类别不同, 则标记 为一个错误。
  6. 使用算法:本例没有完成此步骤,若你感兴趣可以构建完整的应用程序,从图像中提 取数字, 并完成数字识别, 美国的邮件分栋系统就是一个实际运行的类似系统。

图像转换为向量 

def img2vector(filename):
    returnVect = zeros((1,1024))
    fr = open(filename)
    for i in range(32):
        lineStr = fr.readline()
        for j in range(32):
            returnVect[0,32*i+j] = int(lineStr[j])
    return returnVect
testVector = img2vector('digits/testDigits/0_13.txt')
testVector[0,0:31]
array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 1.,
       1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
from os import listdir
def handwritingClassTest():
    hwLables = []
    trainingFileList = listdir('digits/trainingDigits')
    m = len(trainingFileList)
    trainingMat = zeros((m,1024))
    for i in range(m):
        fileNameStr = trainingFileList[i]
        fileStr = fileNameStr.split('.')[0]
        classNumStr = int(fileStr.split('_')[0])
        hwLables.append(classNumStr)
        trainingMat[i,:] = img2vector('digits/trainingDigits/%s' % fileNameStr)
    testFileList = listdir('digits/testDigits')
    errorCount = 0.0
    mTest = len(testFileList)
    for i in range(mTest):
        fileNameStr = testFileList[i]
        fileStr = fileNameStr.split('.')[0]
        classNumStr = int(fileStr.split('_')[0])
        vectorUnderTest = img2vector('digits/testDigits/%s' % fileNameStr)
        classifierResult = classify0(vectorUnderTest, trainingMat,hwLables,3)
        print("the classifier came back width: %d, the real answer is: %d" % (classifierResult,classNumStr))
        if(classifierResult != classNumStr):
            errorCount += 1.0
    print("\nthe total number of errors is :%d" % errorCount)
    print("\nthe total error rate is:%f" % (errorCount/float(mTest)))
handwritingClassTest()
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 3, the real answer is: 8
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 8
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 3, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 8
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 1
the classifier came back width: 7, the real answer is: 9
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 9
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 9, the real answer is: 3
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 7, the real answer is: 7
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 9, the real answer is: 9
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 6, the real answer is: 6
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 3, the real answer is: 3
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 1, the real answer is: 1
the classifier came back width: 2, the real answer is: 2
the classifier came back width: 8, the real answer is: 8
the classifier came back width: 4, the real answer is: 4
the classifier came back width: 0, the real answer is: 0
the classifier came back width: 5, the real answer is: 5
the classifier came back width: 8, the real answer is: 8

the total number of errors is :10

the total error rate is:0.010571

以上就是Python机器学习实战之k-近邻算法的实现的详细内容,更多关于Python k-近邻算法的资料请关注三水点靠木其它相关文章!

Python 相关文章推荐
Python 文件操作实现代码
Oct 07 Python
python登录QQ邮箱发信的实现代码
Feb 10 Python
python使用正则表达式替换匹配成功的组并输出替换的次数
Nov 22 Python
python matplotlib 注释文本箭头简单代码示例
Jan 08 Python
解决Django migrate No changes detected 不能创建表的问题
May 27 Python
python+POP3实现批量下载邮件附件
Jun 19 Python
python简单实现矩阵的乘,加,转置和逆运算示例
Jul 10 Python
python socket通信编程实现文件上传代码实例
Dec 14 Python
TensorFlow中如何确定张量的形状实例
Jun 23 Python
Django启动时找不到mysqlclient问题解决方案
Nov 11 Python
python如何读取.mtx文件
Apr 22 Python
python中24小时制转换为12小时制的方法
Jun 18 Python
Python Django项目和应用的创建详解
python playwright 自动等待和断言详解
Nov 27 #Python
Python实现制作销售数据可视化看板详解
Python 如何利用ffmpeg 处理视频素材
实操Python爬取觅知网素材图片示例
Python函数中apply、map、applymap的区别
Nov 27 #Python
python字符串拼接.join()和拆分.split()详解
Nov 23 #Python
You might like
使用adodb lite解决问题
2006/12/31 PHP
使用ob系列函数实现PHP网站页面静态化
2014/08/13 PHP
PHP explode()函数的几个应用和implode()函数有什么区别
2015/11/05 PHP
PHP+原生态ajax实现的省市联动功能详解
2017/08/15 PHP
php删除一个路径下的所有文件夹和文件的方法
2018/02/07 PHP
去除链接虚线全面分析总结
2006/08/15 Javascript
JavaScript使用prototype定义对象类型(转)[
2006/12/22 Javascript
用js实现多域名不同文件的调用方法
2007/01/12 Javascript
jquery.alert 弹出式复选框实现代码
2009/06/15 Javascript
jQuery html()等方法介绍
2009/11/18 Javascript
用Javascript评估用户输入密码的强度实现代码
2011/11/30 Javascript
IE下Ajax缓存问题的快速解决方法(get方式)
2014/01/09 Javascript
Javascript 函数parseInt()转换时出现bug问题
2014/05/20 Javascript
jQuery针对各类元素操作基础教程
2014/08/29 Javascript
jQuery实现点击图片翻页展示效果的方法
2015/02/16 Javascript
jQuery实现可编辑的表格实例讲解(2)
2015/09/17 Javascript
jquery实现简单实用的弹出层效果代码
2015/10/15 Javascript
jQuery内容折叠效果插件用法实例分析(附demo源码)
2016/04/28 Javascript
javascript正则表达式中分组详解
2016/07/17 Javascript
js从外部获取图片的实现方法
2016/08/05 Javascript
JavaScript性能优化总结之加载与执行
2016/08/11 Javascript
用Angular实时获取本地Localstorage数据,实现一个模拟后台数据登入的效果
2016/11/09 Javascript
浅谈Node.js:Buffer模块
2016/12/05 Javascript
vue-cli4项目开启eslint保存时自动格式问题
2020/07/13 Javascript
Python中的tuple元组详细介绍
2015/02/02 Python
Python字符串大小写转换拼接删除空白
2019/09/19 Python
python使用ctypes调用扩展模块的实例方法
2020/01/28 Python
Snapfish英国:在线照片打印和个性化照片礼品
2017/01/13 全球购物
俄罗斯香水和化妆品购物网站:Л’Этуаль
2018/05/10 全球购物
法国床上用品商店:La Compagnie du lit
2019/12/26 全球购物
酒店副总经理岗位职责范本
2014/02/04 职场文书
行政处罚事先告知书
2015/07/01 职场文书
治理商业贿赂工作总结
2015/08/10 职场文书
转变工作作风心得体会
2016/01/23 职场文书
Python anaconda安装库命令详解
2021/10/16 Python
win10系统计算机图标怎么调出来?win10调出计算机图标的方法
2022/08/14 数码科技