K-nearest neighbors algorithm: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Visual edit
Restored revision 1285981318 by Citation bot (talk): RV
 
Line 4:
 
In [[statistics]], the '''''k''-nearest neighbors algorithm''' ('''''k''-NN''') is a [[Non-parametric statistics|non-parametric]] [[supervised learning]] method. It was first developed by [[Evelyn Fix]] and [[Joseph Lawson Hodges Jr.|Joseph Hodges]] in 1951,<ref>{{Cite report | last1=Fix | first1=Evelyn | last2= Hodges | first2=Joseph L. | title=Discriminatory Analysis. Nonparametric Discrimination: Consistency Properties | issue=Report Number 4, Project Number 21-49-004 | year=1951 | url=https://apps.dtic.mil/dtic/tr/fulltext/u2/a800276.pdf | archive-url=https://web.archive.org/web/20200926212807/https://apps.dtic.mil/dtic/tr/fulltext/u2/a800276.pdf | url-status=live | archive-date=September 26, 2020 | publisher=USAF School of Aviation Medicine, Randolph Field, Texas}}</ref> and later expanded by [[Thomas M. Cover|Thomas Cover]].<ref name=":1" />
Most often, it is used for [[statistical classification|classification]], as a '''''k''-NN classifier''', the output of which is a class membership. An object is classified by a plurality vote of its neighbors, with the object being assigned to the class most common among its ''k'' Eveznearest elyibneighbors ser(''k'' is a positive [[integer]], typically small). If atir''k''&nbsp;=&nbsp;1, then the object is simply assigned to the class of that single nearest neighbor.
 
The ''k''-NN algorithm can also be generalized for [[regression analysis|regression]]. In ''{{mvar|k}}-NN regression'', also known as ''[[nearest neighbor smoothing]]'', the output is the property value for the object. This value is the average of the values of ''k'' nearest neighbors. If ''k'' = 1, then the output is simply assigned to the value of that single nearest neighbor, also known as ''[[nearest neighbor interpolation]]''.