官术网_书友最值得收藏!

K-nearest neighbors

KNN is an algorithm that's used in pattern recognition for object classification based on the characteristics of the nearest objects. An object is classified according to the majority of the votes of its neighboring k cluster. The k integer is a positive integer that is typically not very large. If the value of k is 1, then the object is assigned to its neighbor's class. In a binary context in which there are only two classes, it is appropriate to choose k with an odd value to avoid being in a situation of parity. It is the simplest algorithm among those used in machine learning.

Therefore, KNN identifies the class of belonging to a tested sample based on its distance from stored and classified objects. In most cases, the Euclidean distance is used. On a bidimensional plane, the Euclidean distance represents the minimum distance between two points, which is essentially the straight line connecting two points on a graph. This distance is calculated as the square root of the sum of the squared difference between the elements of two vectors. An object is assigned to the class based on the majority vote of its neighbors, and then the most common among its KNN is chosen.

主站蜘蛛池模板: 色达县| 综艺| 长治县| 永登县| 淮南市| 桃江县| 宁波市| 久治县| 临夏县| 木里| 老河口市| 溧水县| 长兴县| 黑河市| 永宁县| 镇康县| 宁阳县| 孙吴县| 绿春县| 兰溪市| 富宁县| 长宁区| 壤塘县| 锡林郭勒盟| 呼图壁县| 博乐市| 芜湖市| 宜良县| 湾仔区| 临沂市| 汨罗市| 和硕县| 河曲县| 林芝县| 常熟市| 嘉鱼县| 班玛县| 陇南市| 高陵县| 乌什县| 剑阁县|