楼主: zhangwc08
1431 0

[程序分享] k-nearest neighbors algorithm [推广有奖]

  • 0关注
  • 0粉丝

高中生

60%

还不是VIP/贵宾

-

威望
0
论坛币
5 个
通用积分
0.0003
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
136 点
帖子
27
精华
0
在线时间
3 小时
注册时间
2013-1-29
最后登录
2016-1-25

楼主
zhangwc08 发表于 2015-10-17 07:17:07 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

n pattern recognition, the k-Nearest Neighbors algorithm (or k-NN for short) is a non-parametricmethod used for classification and regression.[1] In both cases, the input consists of the k closest training examples in the feature space. The output depends on whether k-NN is used for classification or regression:

  • In k-NN classification, the output is a class membership. An object is classified by a majority vote of its neighbors, with the object being assigned to the class most common among its k nearest neighbors (k is a positive integer, typically small). If k = 1, then the object is simply assigned to the class of that single nearest neighbor.
  • In k-NN regression, the output is the property value for the object. This value is the average of the values of its k nearest neighbors.

k-NN is a type of instance-based learning, or lazy learning, where the function is only approximated locally and all computation is deferred until classification. The k-NN algorithm is among the simplest of all machine learning algorithms.

Both for classification and regression, it can be useful to assign weight to the contributions of the neighbors, so that the nearer neighbors contribute more to the average than the more distant ones. For example, a common weighting scheme consists in giving each neighbor a weight of 1/d, where d is the distance to the neighbor.machine learningtechnique.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Algorithm near Rest ear ARE membership assigned examples training depends

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 06:40