登录
首页 » Python » python-实现knn算法

python-实现knn算法

于 2022-02-02 发布 文件大小:774.69 kB
0 145
下载积分: 2 下载次数: 2

代码说明:

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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Learning_Python_(5th_Edition)
    learning python第五版,经典书籍,学习python必看。(Learning Python fifth edition, classic books, learning must see.)
    2020-06-24 03:20:01下载
    积分:1
  • Python学习手册(第4版)
    The fourth edition of the python learning manual
    2020-10-29 18:49:56下载
    积分:1
  • Python_medical
    说明:  example used in Python & VTK
    2020-06-16 05:20:02下载
    积分:1
  • 30个常用python实现
    说明:  30个常用Python程序实现,包括冒泡算法之类(30 commonly used Python programs, including bubbling algorithms and the like)
    2020-10-29 18:49:56下载
    积分:1
  • MNIST手写字体识别
    http://blog.csdn.net/yhl_leo/article/details/50738311https://zhuanlan.zhihu.com/p/24055668如TensorFlow还没安装,可参考以上两个链接,环境配置好后,直接运行后,会自动下载MNIST数据,训练模型
    2022-01-28 00:21:37下载
    积分:1
  • 开源爬虫数据操作教程
    说明:  数据爬取,通过几行代码就可以在openstreetmap上爬取自己想要的路网/铁路网/地铁/自行车/步行的node.csv和link.csv文件。(Data crawling.With a few lines of code, you can climb the road network / railway network / subway / bicycle / pedestrian network you want on OpenStreetMap node.csv and link.csv Documents.)
    2020-12-26 09:44:32下载
    积分:1
  • RED-WGAN-master
    3D MRI denoising based deep learning.
    2020-06-17 07:40:01下载
    积分:1
  • chapter-1
    abaqus中python开发的一些例子(some examples of python in abaqus)
    2012-07-03 19:35:38下载
    积分:1
  • 烟花算法python
    说明:  烟花算法python版本,分享给需要的同学们(Fireworks Algorithn python)
    2021-04-20 15:58:50下载
    积分:1
  • 熵权法(python
    说明:  熵权法根据各指标的变异程度,利用信息熵计算出各指标的熵权,再通过熵权对各指标的权重进行修正,从而得出较为客观的指标权重。(According to the variation degree of each index, the entropy weight of each index is calculated by using information entropy, and then the weight of each index is revised by the entropy weight, thus objectively obtaining the weight of each index.)
    2019-05-28 23:40:19下载
    积分:1
  • 696516资源总数
  • 106668会员总数
  • 21今日下载