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

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.

主站蜘蛛池模板: 中江县| 格尔木市| 嵩明县| 双辽市| 永清县| 潼南县| 灌云县| 德昌县| 霸州市| 浦北县| 邯郸县| 宜城市| 孟连| 西青区| 云浮市| 汽车| 巩义市| 稻城县| 馆陶县| 乌海市| 武宁县| 田阳县| 东乌| 朝阳区| 富锦市| 正镶白旗| 丹东市| 尚志市| 社会| 日土县| 治县。| 京山县| 葫芦岛市| 建平县| 海兴县| 绥阳县| 鹤山市| 徐州市| 辛集市| 宜州市| 额济纳旗|