Explain The k-Nearest Neighbor Algorithm.
The k-Nearest Neighbor Algorithm
• The k-nearest-neighbor method was first described in the early 1950s.
• The k-nearest neighbor algorithm is amongst the simplest of all machine learning algorithms: an object is classified by a majority vote of its neighbors, with the object being assigned to the class most common amongst its k nearest neighbors (k is a positive integer, typically small).
• If k = 1, then the object is simply assigned to the class of its nearest neighbor.
The test sample (green circle) should be classified either to the first class of blue squares or to the second class of red triangles. If k = 3 it is assigned to the second class because there are 2 triangles and only 1 square inside the inner circle. If k = 5 it is assigned to the first class (3 squares vs. 2 triangles inside the outer circle).
Comments
Post a Comment