iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >Python机器学习实战之k-近邻算法的实现
  • 124
分享到

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

2024-04-02 19:04:59 124人浏览 独家记忆

Python 官方文档:入门教程 => 点击学习

摘要

目录K-近邻算法概述工作原理实施KNN算法示例:手写识别系统K-近邻算法概述 简单地说, k-近邻算法采用测量不同特征值之间的距离方法进行分类。 k-近邻算法 优点:精度高

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'

示例:手写识别系统

数据集如下图:

示例: 使用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-近邻算法的资料请关注编程网其它相关文章!

--结束END--

本文标题: Python机器学习实战之k-近邻算法的实现

本文链接: https://www.lsjlt.com/news/158558.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Python机器学习实战之k-近邻算法的实现
    目录K-近邻算法概述工作原理实施KNN算法示例:手写识别系统K-近邻算法概述 简单地说, k-近邻算法采用测量不同特征值之间的距离方法进行分类。 k-近邻算法 优点:精度高...
    99+
    2024-04-02
  • Python机器学习k-近邻算法怎么实现
    这篇文章主要介绍“Python机器学习k-近邻算法怎么实现”,在日常操作中,相信很多人在Python机器学习k-近邻算法怎么实现问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Python机器学习k-近邻算法怎...
    99+
    2023-06-21
  • 【python】机器学习-K-近邻(KNN)算法
             目录 一 . K-近邻算法(KNN)概述  二、KNN算法实现 三、 MATLAB实现 四、 实战 一 . K-近邻算法(KNN)概述          K-近邻算法(KNN)是一种基本的分类算法,它通过计算数据点之...
    99+
    2023-10-22
    python matlab 机器学习 算法
  • Python机器学习之KNN近邻算法
    目录一、KNN概述二、使用Python导入数据三、numpy.array()四、实施KNN分类算法五、计算已知类别数据集中的点与当前点之间的距离六、完整代码七、数据处理、分析、测试八...
    99+
    2024-04-02
  • python机器学习基础K近邻算法详解KNN
    目录一、k-近邻算法原理及API1.k-近邻算法原理2.k-近邻算法API3.k-近邻算法特点二、k-近邻算法案例分析案例信息概述第一部分:处理数据1.数据量缩小2.处理时间3.进一...
    99+
    2024-04-02
  • Python实现K-近邻算法的示例代码
    目录一、介绍二、k-近邻算法的步骤三、Python 实现四、约会网站配对效果判定五、手写数字识别六、算法优缺点优点缺点一、介绍 k-近邻算法(K-Nearest Neighbour ...
    99+
    2024-04-02
  • Python怎么用scikit-learn实现近邻算法分类
    今天小编给大家分享一下Python怎么用scikit-learn实现近邻算法分类的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧...
    99+
    2023-07-05
  • Python实现机器学习算法的分类
    Python算法的分类 对葡萄酒数据集进行测试,由于数据集是多分类且数据的样本分布不平衡,所以直接对数据测试,效果不理想。所以使用SMOTE过采样对数据进行处理,对数据去重,去空,处...
    99+
    2024-04-02
  • python机器学习实战(一)
    原文链接:www.cnblogs.com/fydeblog/p/7140974.html 前言 这篇notebook是关于机器学习中监督学习的k近邻算法,将介绍2个实例,分别是使用k-近邻算法改进约会网站的效果和手写识别系统.操作系统:u...
    99+
    2023-01-31
    实战 机器 python
  • python机器学习实战(三)
    原文链接:www.cnblogs.com/fydeblog/p/7277205.html 前言 这篇博客是关于机器学习中基于概率论的分类方法--朴素贝叶斯,内容包括朴素贝叶斯分类器,垃圾邮件的分类,解析RSS源数据以及用朴素贝叶斯来分析不...
    99+
    2023-01-31
    实战 机器 python
  • Python机器学习算法之决策树算法的实现与优缺点
    目录1.算法概述2.算法种类3.算法示例4.决策树构建示例5.算法实现步骤 6.算法相关概念7.算法实现代码8.算法优缺点9.算法优化总结1.算法概述 决策树算法是在已知各...
    99+
    2024-04-02
  • python机器学习Sklearn实战adaboost算法示例详解
    目录pandas批量处理体测成绩adaboostadaboost原理案例举例弱分类器合并成强分类器pandas批量处理体测成绩 import numpy as np import...
    99+
    2024-04-02
  • 机器学习之决策树算法怎么实现
    决策树是一种常用的机器学习算法,主要用于分类和回归问题。下面是决策树算法的实现步骤:1. 数据预处理:将原始数据进行清洗和转换,包括...
    99+
    2023-10-11
    机器学习
  • Python机器学习实战教程
    Python机器学习实战教程分享网盘地址——https://pan.baidu.com/s/1miIb4og 密码: wtiw课程真心不错,分享给大家机器学习(Machine Learning, ML)是一门多领域交叉学科,涉及概率论、统计...
    99+
    2023-01-31
    实战 机器 教程
  • 【机器学习】DBSCAN聚类算法(含Python实现)
    文章目录 一、算法介绍二、例子三、Python实现3.1 例13.2 算法参数详解3.3 鸢尾花数据集 一、算法介绍 DBSCAN(Density-Based Spatial Clus...
    99+
    2023-10-01
    聚类 机器学习 python BBSCAN
  • Python利用scikit-learn实现近邻算法分类的示例详解
    scikit-learn库 scikit-learn已经封装好很多数据挖掘的算法 现介绍数据挖掘框架的搭建方法 1.转换器(Transformer)用于数据预处理,数据转换 2.流水...
    99+
    2023-02-28
    Python scikit-learn近邻算法分类 Python 近邻算法分类 Python scikit-learn
  • PythonOpenCV实战之与机器学习的碰撞
    目录0.前言1.机器学习简介1.1监督学习1.2无监督学习1.3半监督学习2.K均值(K-Means)聚类2.1K-Means聚类示例3.K最近邻3.1K最近邻示例4.支持向量机4....
    99+
    2024-04-02
  • Python机器学习之随机梯度下降法的实现
    目录随机梯度下降法随机梯度下降法的实现随机梯度下降法 为什么使用随机梯度下降法? 如果当我们数据量和样本量非常大时,每一项都要参与到梯度下降,那么它的计算量时非常大的,所以我们可以采...
    99+
    2023-02-27
    Python随机梯度下降法 Python梯度下降法 Python梯度下降
  • 机器学习:LightGBM算法原理(附案例实战)
    机器学习:LightGBM算法原理(附案例实战) 作者:i阿极 作者简介:Python领域新星作者、多项比赛获奖者:博主个人首页 😊😊😊如果觉得文章不错或能帮助到你学习,可以点赞👍收藏📁评论...
    99+
    2023-09-13
    机器学习 算法 python LightGBM 开发语言
  • Python机器学习之随机梯度下降法如何实现
    本文小编为大家详细介绍“Python机器学习之随机梯度下降法如何实现”,内容详细,步骤清晰,细节处理妥当,希望这篇“Python机器学习之随机梯度下降法如何实现”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。随机梯...
    99+
    2023-07-05
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作